op/clip: unexport Rect.Op

It wasn't used anywhere outside Rect.Add.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-07-09 17:27:48 +02:00
parent 29f820caaa
commit 4818538ef8
9 changed files with 22 additions and 22 deletions
+4 -4
View File
@@ -94,7 +94,7 @@ func Clickable(gtx layout.Context, button *widget.Clickable, w layout.Widget) la
X: float32(gtx.Constraints.Min.X),
Y: float32(gtx.Constraints.Min.Y),
}},
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
for _, c := range button.History() {
drawInk(gtx, c)
}
@@ -128,7 +128,7 @@ func (b ButtonLayoutStyle) Layout(gtx layout.Context, w layout.Widget) layout.Di
Y: float32(gtx.Constraints.Min.Y),
}},
NE: rr, NW: rr, SE: rr, SW: rr,
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
background := b.Background
if gtx.Queue == nil {
background = mulAlpha(b.Background, 150)
@@ -156,7 +156,7 @@ func (b IconButtonStyle) Layout(gtx layout.Context) layout.Dimensions {
clip.Rect{
Rect: f32.Rectangle{Max: f32.Point{X: sizef, Y: sizef}},
NE: rr, NW: rr, SE: rr, SW: rr,
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
background := b.Background
if gtx.Queue == nil {
background = mulAlpha(b.Background, 150)
@@ -288,6 +288,6 @@ func drawInk(gtx layout.Context, c widget.Press) {
Y: float32(size),
}},
NE: rr, NW: rr, SE: rr, SW: rr,
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
paint.PaintOp{Rect: f32.Rectangle{Max: f32.Point{X: float32(size), Y: float32(size)}}}.Add(gtx.Ops)
}
+1 -1
View File
@@ -38,7 +38,7 @@ func (p ProgressBarStyle) Layout(gtx layout.Context) layout.Dimensions {
clip.Rect{
Rect: f32.Rectangle{Max: f32.Point{X: width, Y: float32(gtx.Px(maxHeight))}},
NE: rr, NW: rr, SE: rr, SW: rr,
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
paint.ColorOp{Color: color}.Add(gtx.Ops)
paint.PaintOp{Rect: dr}.Add(gtx.Ops)
+3 -3
View File
@@ -70,7 +70,7 @@ func (s SliderStyle) Layout(gtx layout.Context) layout.Dimensions {
Y: halfWidth + trackWidth/2,
},
}
clip.Rect{Rect: track}.Op(gtx.Ops).Add(gtx.Ops)
clip.Rect{Rect: track}.Add(gtx.Ops)
paint.ColorOp{Color: color}.Add(gtx.Ops)
paint.PaintOp{Rect: track}.Add(gtx.Ops)
st.Pop()
@@ -79,7 +79,7 @@ func (s SliderStyle) Layout(gtx layout.Context) layout.Dimensions {
st = op.Push(gtx.Ops)
track.Min.X = thumbPos
track.Max.X = float32(size.X) - halfWidth
clip.Rect{Rect: track}.Op(gtx.Ops).Add(gtx.Ops)
clip.Rect{Rect: track}.Add(gtx.Ops)
paint.ColorOp{Color: mulAlpha(color, 96)}.Add(gtx.Ops)
paint.PaintOp{Rect: track}.Add(gtx.Ops)
st.Pop()
@@ -100,7 +100,7 @@ func (s SliderStyle) Layout(gtx layout.Context) layout.Dimensions {
clip.Rect{
Rect: thumb,
NE: rr, NW: rr, SE: rr, SW: rr,
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
paint.ColorOp{Color: color}.Add(gtx.Ops)
paint.PaintOp{Rect: thumb}.Add(gtx.Ops)
st.Pop()
+3 -3
View File
@@ -59,7 +59,7 @@ func (s SwitchStyle) Layout(gtx layout.Context) layout.Dimensions {
clip.Rect{
Rect: trackRect,
NE: trackCorner, NW: trackCorner, SE: trackCorner, SW: trackCorner,
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
paint.ColorOp{Color: trackColor}.Add(gtx.Ops)
paint.PaintOp{Rect: trackRect}.Add(gtx.Ops)
stack.Pop()
@@ -79,7 +79,7 @@ func (s SwitchStyle) Layout(gtx layout.Context) layout.Dimensions {
Max: layout.FPt(gtx.Constraints.Min),
},
NE: rr, NW: rr, SE: rr, SW: rr,
}.Op(gtx.Ops).Add(gtx.Ops)
}.Add(gtx.Ops)
for _, p := range s.Switch.History() {
drawInk(gtx, p)
}
@@ -130,7 +130,7 @@ func drawDisc(ops *op.Ops, sz float32, col color.RGBA) {
clip.Rect{
Rect: r,
NE: rr, NW: rr, SE: rr, SW: rr,
}.Op(ops).Add(ops)
}.Add(ops)
paint.ColorOp{Color: col}.Add(ops)
paint.PaintOp{Rect: r}.Add(ops)
}