diff options
author | Colin Okay <okay@toyful.space> | 2022-07-23 17:04:22 -0500 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-07-23 17:04:22 -0500 |
commit | 294abc20603b1f9c53f1379d9c163f80c1aeaeac (patch) | |
tree | 4ad342d72fa0e155ac8372884864a6bb6ebd38d8 /src | |
parent | 228eebe0a022fac2159c53f504fae8628268b9b9 (diff) |
[change] only bother witht the scissor box if the box isn't the app
Diffstat (limited to 'src')
-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) |