diff --git a/widget/border.go b/widget/border.go index 86e356da..c3f6ede7 100644 --- a/widget/border.go +++ b/widget/border.go @@ -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),