mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget: make border draw within widget dims as documented
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user