op/clip: split Rect into pixel-aligned Rect and rounded RRect

The pixel-aligned Rect is more efficient and easier to use in the common case
of layout clipping.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-07-09 18:06:00 +02:00
parent 4818538ef8
commit d572aa23ac
14 changed files with 105 additions and 116 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ func (p ProgressBarStyle) Layout(gtx layout.Context) layout.Dimensions {
Max: f32.Point{X: float32(d.X), Y: float32(d.Y)},
}
clip.Rect{
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)