mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
gpu: fix negative intersections
Fixes a bug due to that f32.Rect.Intersect will not return the empty rectangle for non intersecting rectangles - but instead a swapped rectangle. By removing the .Canon() call in gpu.go we ensure that non overlapping clipping rects and paint rects will lead to no painting. The Canon() call is not needed since boundsForTransformedRect() was previously updated to always return a canonical rectangle. Test case added. Signed-off-by: Viktor <viktor.ogeman@gmail.com>
This commit is contained in:
committed by
Elias Naur
parent
5bd0ecea5e
commit
7ff17453dd
+1
-1
@@ -768,7 +768,7 @@ loop:
|
||||
// the new bounding rectangle and the transformed original paint rectangle.
|
||||
trans, off := splitTransform(state.t)
|
||||
clipData, bnd, partialTrans := d.boundsForTransformedRect(op.Rect, trans)
|
||||
clip := state.clip.Intersect(bnd.Add(off)).Canon()
|
||||
clip := state.clip.Intersect(bnd.Add(off))
|
||||
if clip.Empty() {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user