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:
Pierre Curto
2021-11-10 22:18:59 +01:00
committed by Elias Naur
parent 86c4947ccd
commit 9d05f35341
4 changed files with 13 additions and 11 deletions
+2 -1
View File
@@ -955,7 +955,8 @@ loop:
inf := float32(1e6)
dst := f32.Rect(-inf, -inf, inf, inf)
if state.matType == materialTexture {
dst = layout.FRect(state.image.src.Rect)
sz := state.image.src.Rect.Size()
dst = f32.Rectangle{Max: layout.FPt(sz)}
}
clipData, bnd, partialTrans := d.boundsForTransformedRect(dst, t)
cl := viewport.Intersect(bnd.Add(off))