widget: fixed missing sides in Border

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2021-03-15 13:33:08 +01:00
committed by Elias Naur
parent 258033d0b0
commit 4d4b3a627a
+4 -2
View File
@@ -21,12 +21,14 @@ type Border struct {
func (b Border) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
dims := w(gtx)
sz := dims.Size
sz := layout.FPt(dims.Size)
rr := float32(gtx.Px(b.CornerRadius))
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})
paint.FillShape(gtx.Ops,