summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-08 15:20:34 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-08 15:20:34 +0200
commitfaed2c3a7894b1b7b3ad7528540487ae6deb3d93 (patch)
tree110493e478cd5e78a266c2ea5728d9484a2fd417 /src
parentbc1a8938e6253b6da4290ea5747bfe3558a3b92e (diff)
Paint: Fixed another clipping issue
Ensure that painting is always clipped to the root rectangle.
Diffstat (limited to 'src')
-rw-r--r--src/ui/paint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/paint.c b/src/ui/paint.c
index 67b509fb..5f19ec3e 100644
--- a/src/ui/paint.c
+++ b/src/ui/paint.c
@@ -77,7 +77,8 @@ void setClip_Paint(iPaint *d, iRect rect) {
77 SDL_QueryTexture(target, NULL, NULL, &targetRect.size.x, &targetRect.size.y); 77 SDL_QueryTexture(target, NULL, NULL, &targetRect.size.x, &targetRect.size.y);
78 rect = intersect_Rect(rect, targetRect); 78 rect = intersect_Rect(rect, targetRect);
79 } 79 }
80 else { 80 /* The origin is non-zero when drawing into a widget's own buffer. */
81 if (isEqual_I2(zero_I2(), origin_Paint)) {
81 rect = intersect_Rect(rect, rect_Root(get_Root())); 82 rect = intersect_Rect(rect, rect_Root(get_Root()));
82 } 83 }
83 if (isEmpty_Rect(rect)) { 84 if (isEmpty_Rect(rect)) {