mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 23:55:39 +00:00
layout: invert baseline to measure positive distance from bottom
With an inverted baseline, the zero value results in the widget baseline aligned to its bottom. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -46,5 +46,5 @@ func (im Image) Layout(gtx *layout.Context) {
|
||||
}
|
||||
im.Src.Add(gtx.Ops)
|
||||
paint.PaintOp{Rect: dr}.Add(gtx.Ops)
|
||||
gtx.Dimensions = layout.Dimensions{Size: d, Baseline: d.Y}
|
||||
gtx.Dimensions = layout.Dimensions{Size: d}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ func fill(gtx *layout.Context, col color.RGBA) {
|
||||
}
|
||||
paint.ColorOp{Color: col}.Add(gtx.Ops)
|
||||
paint.PaintOp{Rect: dr}.Add(gtx.Ops)
|
||||
gtx.Dimensions = layout.Dimensions{Size: d, Baseline: d.Y}
|
||||
gtx.Dimensions = layout.Dimensions{Size: d}
|
||||
}
|
||||
|
||||
// https://pomax.github.io/bezierinfo/#circles_cubic.
|
||||
|
||||
Reference in New Issue
Block a user