mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
op/paint: fix subimage rendering by ImageOp
This change is a follow-up to bcf3ff77ff, fixing the two renderers to
properly render images with non-zero origins.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
+3
-2
@@ -1802,8 +1802,9 @@ func (c *collector) collect(root *op.Ops, viewport image.Point, texOps *[]textur
|
||||
paintState := state
|
||||
if paintState.matType == materialTexture {
|
||||
// Clip to the bounds of the image, to hide other images in the atlas.
|
||||
bounds := paintState.image.src.Bounds()
|
||||
c.addClip(&paintState, fview, layout.FRect(bounds), nil, ops.Key{}, 0, 0, false)
|
||||
sz := state.image.src.Rect.Size()
|
||||
bounds := f32.Rectangle{Max: layout.FPt(sz)}
|
||||
c.addClip(&paintState, fview, bounds, nil, ops.Key{}, 0, 0, false)
|
||||
}
|
||||
intersect := paintState.clip.intersect
|
||||
if intersect.Empty() {
|
||||
|
||||
Reference in New Issue
Block a user