widget/material: use clip.UniformRRect

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2021-01-21 08:41:09 +01:00
committed by Elias Naur
parent 9bede80a3d
commit b24df0aa6e
3 changed files with 7 additions and 31 deletions
+2 -5
View File
@@ -35,11 +35,8 @@ func (p ProgressBarStyle) Layout(gtx layout.Context) layout.Dimensions {
d := image.Point{X: int(width), Y: gtx.Px(maxHeight)}
clip.RRect{
Rect: f32.Rectangle{Max: f32.Point{X: width, Y: float32(gtx.Px(maxHeight))}},
NE: rr, NW: rr, SE: rr, SW: rr,
}.Add(gtx.Ops)
height := float32(gtx.Px(maxHeight))
clip.UniformRRect(f32.Rectangle{Max: f32.Pt(width, height)}, rr).Add(gtx.Ops)
paint.ColorOp{Color: color}.Add(gtx.Ops)
paint.PaintOp{}.Add(gtx.Ops)