~eliasnaur/gio

9231ff47efc57f4e56e18794aeee8a7d4a7bbf62 — Chris Waldon 5 months ago d688673
widget: make border draw within widget dims as documented

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
1 files changed, 6 insertions(+), 0 deletions(-)

M widget/border.go
M widget/border.go => widget/border.go +6 -0
@@ 26,6 26,12 @@ func (b Border) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
	rr := float32(gtx.Px(b.CornerRadius))
	st := op.Save(gtx.Ops)
	width := gtx.Px(b.Width)
	sz.X -= width
	sz.Y -= width
	op.Offset(f32.Point{
		X: float32(width) * 0.5,
		Y: float32(width) * 0.5,
	}).Add(gtx.Ops)
	clip.Border{
		Rect: f32.Rectangle{
			Max: layout.FPt(sz),