mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
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:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user