~eliasnaur/gio

gio/internal/ops/ops.go -rw-r--r-- 455 bytes View raw
efce78d4metaclips example/kitchen: add ProgressBar example 5 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-License-Identifier: Unlicense OR MIT

package ops

import (
	"encoding/binary"
	"math"

	"gioui.org/f32"
	"gioui.org/internal/opconst"
	"gioui.org/op"
)

func DecodeTransformOp(d []byte) op.TransformOp {
3 references
bo := binary.LittleEndian if opconst.OpType(d[0]) != opconst.TypeTransform { panic("invalid op") } return op.TransformOp{}.Offset(f32.Point{ X: math.Float32frombits(bo.Uint32(d[1:])), Y: math.Float32frombits(bo.Uint32(d[5:])), }) }