gpu,widget,op/paint,gpu: remove support for ImageOp.Rect

This is effectively a revert of commit gioui.org/commit/69dfd2e3a5541.

ImageOp.Rect is the wrong abstraction; it implies a clipping operation that is
better handled by package clip.

API change. Uses of ImageOp.Rect should apply a clip.Rect before the PaintOp,
or use image.RGBA.SubImage (or similar).

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-11-03 16:19:54 +01:00
parent 6d98eccad0
commit 852958f4b5
4 changed files with 8 additions and 25 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ func (im Image) Layout(gtx layout.Context) layout.Dimensions {
if scale == 0 {
scale = 160.0 / 72.0
}
size := im.Src.Rect.Size()
size := im.Src.Size()
wf, hf := float32(size.X), float32(size.Y)
w, h := gtx.Px(unit.Dp(wf*scale)), gtx.Px(unit.Dp(hf*scale))
cs := gtx.Constraints