mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +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))
|
rr := float32(gtx.Px(b.CornerRadius))
|
||||||
st := op.Save(gtx.Ops)
|
st := op.Save(gtx.Ops)
|
||||||
width := gtx.Px(b.Width)
|
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{
|
clip.Border{
|
||||||
Rect: f32.Rectangle{
|
Rect: f32.Rectangle{
|
||||||
Max: layout.FPt(sz),
|
Max: layout.FPt(sz),
|
||||||
|
|||||||
Reference in New Issue
Block a user