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:
Elias Naur
2019-10-16 00:36:31 +02:00
parent 8e3d03f2c4
commit e2d0b3cfca
6 changed files with 32 additions and 41 deletions
+1 -1
View File
@@ -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}
}