diff options
-rw-r--r-- | src/core/unit.lisp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core/unit.lisp b/src/core/unit.lisp index e56c01f..8fe6521 100644 --- a/src/core/unit.lisp +++ b/src/core/unit.lisp @@ -14,14 +14,19 @@ (defmethod render :around ((unit unit)) (when (unit-visiblep unit) - (let ((sb - (gl:get* :scissor-box)) - (scale - (application-scale *application*))) - (with-slots (left right top bottom) (unit-region unit) - (gl:scissor (* left scale) (* bottom scale) (* scale (- right left)) (* scale (- top bottom))) - (call-next-method)) - (gl:scissor (aref sb 0) (aref sb 1) (aref sb 2) (aref sb 3))))) + (if (not (eq *application* (unit-region unit))) + (let ((sb + (gl:get* :scissor-box)) + (scale + (application-scale *application*))) + (with-slots (left right top bottom) (unit-region unit) + (gl:scissor (* left scale) + (* bottom scale) + (* scale (- right left)) + (* scale (- top bottom))) + (call-next-method)) + (gl:scissor (aref sb 0) (aref sb 1) (aref sb 2) (aref sb 3))) + (call-next-method)))) (defmethod (setf closer-mop:slot-value-using-class) :after (newval class (unit unit) slot) |