mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
ui: make the reference list argument to Ops.Write variadic
Makes the code nicer. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-3
@@ -34,7 +34,7 @@ func (i OpImage) Add(o *ui.Ops) {
|
||||
bo.PutUint32(data[5:], uint32(i.Rect.Min.Y))
|
||||
bo.PutUint32(data[9:], uint32(i.Rect.Max.X))
|
||||
bo.PutUint32(data[13:], uint32(i.Rect.Max.Y))
|
||||
o.Write(data, []interface{}{i.Img})
|
||||
o.Write(data, i.Img)
|
||||
}
|
||||
|
||||
func (i *OpImage) Decode(data []byte, refs []interface{}) {
|
||||
@@ -65,7 +65,7 @@ func (c OpColor) Add(o *ui.Ops) {
|
||||
data[2] = c.Col.G
|
||||
data[3] = c.Col.B
|
||||
data[4] = c.Col.A
|
||||
o.Write(data, nil)
|
||||
o.Write(data)
|
||||
}
|
||||
|
||||
func (c *OpColor) Decode(data []byte, refs []interface{}) {
|
||||
@@ -90,7 +90,7 @@ func (d OpDraw) Add(o *ui.Ops) {
|
||||
bo.PutUint32(data[5:], math.Float32bits(d.Rect.Min.Y))
|
||||
bo.PutUint32(data[9:], math.Float32bits(d.Rect.Max.X))
|
||||
bo.PutUint32(data[13:], math.Float32bits(d.Rect.Max.Y))
|
||||
o.Write(data, nil)
|
||||
o.Write(data)
|
||||
}
|
||||
|
||||
func (d *OpDraw) Decode(data []byte, refs []interface{}) {
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ func (p opClip) Add(o *ui.Ops) {
|
||||
bo.PutUint32(data[5:], math.Float32bits(p.bounds.Min.Y))
|
||||
bo.PutUint32(data[9:], math.Float32bits(p.bounds.Max.X))
|
||||
bo.PutUint32(data[13:], math.Float32bits(p.bounds.Max.Y))
|
||||
o.Write(data, nil)
|
||||
o.Write(data)
|
||||
}
|
||||
|
||||
// MoveTo moves the pen to the given position.
|
||||
@@ -246,7 +246,7 @@ func (p *PathBuilder) vertex(o *ui.Ops, cornerx, cornery int16, ctrl, to f32.Poi
|
||||
bo.PutUint32(data[21:], math.Float32bits(v.CtrlY))
|
||||
bo.PutUint32(data[25:], math.Float32bits(v.ToX))
|
||||
bo.PutUint32(data[29:], math.Float32bits(v.ToY))
|
||||
o.Write(data, nil)
|
||||
o.Write(data)
|
||||
}
|
||||
|
||||
func (p *PathBuilder) simpleQuadTo(ops *ui.Ops, ctrl, to f32.Point) {
|
||||
|
||||
Reference in New Issue
Block a user