clip: change Rect argument to f32.Rectangle

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-11-09 19:42:19 +01:00
parent 4f30b985eb
commit 65c783179d
3 changed files with 21 additions and 5 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ func (im Image) Layout(gtx *layout.Context) {
d := image.Point{X: cs.Width.Constrain(w), Y: cs.Height.Constrain(h)}
var s op.StackOp
s.Push(gtx.Ops)
clip.Rect(image.Rectangle{Max: d}).Add(gtx.Ops)
clip.Rect(gtx.Ops, f32.Rectangle{Max: toPointF(d)}).Add(gtx.Ops)
im.Src.Add(gtx.Ops)
paint.PaintOp{Rect: f32.Rectangle{Max: f32.Point{X: float32(w), Y: float32(h)}}}.Add(gtx.Ops)
s.Pop()