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:
Elias Naur
2019-06-03 14:07:56 +02:00
parent 402837bbfa
commit 955fe1bc77
6 changed files with 25 additions and 21 deletions
+3 -3
View File
@@ -77,7 +77,7 @@ func (r OpRedraw) Add(o *Ops) {
bo.PutUint64(data[1:], uint64(nanos))
}
}
o.Write(data, nil)
o.Write(data)
}
func (r *OpRedraw) Decode(d []byte) {
@@ -110,7 +110,7 @@ func (t OpTransform) Add(o *Ops) {
bo := binary.LittleEndian
bo.PutUint32(data[1:], math.Float32bits(t.Transform.offset.X))
bo.PutUint32(data[5:], math.Float32bits(t.Transform.offset.Y))
o.Write(data, nil)
o.Write(data)
}
func (t *OpTransform) Decode(d []byte) {
@@ -129,7 +129,7 @@ func (t *OpTransform) Decode(d []byte) {
func (l OpLayer) Add(o *Ops) {
data := make([]byte, ops.TypeLayerLen)
data[0] = byte(ops.TypeLayer)
o.Write(data, nil)
o.Write(data)
}
func (l *OpLayer) Decode(d []byte) {