mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +00:00
ui: split OpImage into OpImage and OpDraw
In preparation for an OpColor (and future OpGradient and similar). Label and Editor no longer take an explicit source image. They draw with the current image. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-1
@@ -27,6 +27,7 @@ func (im Image) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens {
|
||||
dr := f32.Rectangle{
|
||||
Max: f32.Point{X: float32(d.X), Y: float32(d.Y)},
|
||||
}
|
||||
draw.OpImage{Rect: dr, Src: im.Src, SrcRect: im.Rect}.Add(ops)
|
||||
draw.OpImage{Img: im.Src, Rect: im.Rect}.Add(ops)
|
||||
draw.OpDraw{Rect: dr}.Add(ops)
|
||||
return layout.Dimens{Size: d, Baseline: d.Y}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user