mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
widget: fixed missing sides in Border
Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
+4
-2
@@ -21,12 +21,14 @@ type Border struct {
|
|||||||
|
|
||||||
func (b Border) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
|
func (b Border) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
|
||||||
dims := w(gtx)
|
dims := w(gtx)
|
||||||
sz := dims.Size
|
sz := layout.FPt(dims.Size)
|
||||||
|
|
||||||
rr := float32(gtx.Px(b.CornerRadius))
|
rr := float32(gtx.Px(b.CornerRadius))
|
||||||
width := float32(gtx.Px(b.Width))
|
width := float32(gtx.Px(b.Width))
|
||||||
|
sz.X -= width
|
||||||
|
sz.Y -= width
|
||||||
|
|
||||||
r := f32.Rectangle{Max: layout.FPt(sz)}
|
r := f32.Rectangle{Max: sz}
|
||||||
r = r.Add(f32.Point{X: width * 0.5, Y: width * 0.5})
|
r = r.Add(f32.Point{X: width * 0.5, Y: width * 0.5})
|
||||||
|
|
||||||
paint.FillShape(gtx.Ops,
|
paint.FillShape(gtx.Ops,
|
||||||
|
|||||||
Reference in New Issue
Block a user