~eliasnaur/gio

ref: 9f58ed0fea4e7b1f8f69846d8f72bec19390d7ed gio/ui/internal/path/path.go -rw-r--r-- 602 bytes
9f58ed0fElias Naur ui: add version to OpBlock to track invalidated blocks 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: Unlicense OR MIT

package path

import (
	"unsafe"

	"gioui.org/ui/f32"
)

type Path struct {
	Vertices []Vertex
	Bounds   f32.Rectangle
}

// The vertex data suitable for passing to vertex programs.
type Vertex struct {
	CornerX, CornerY int16
	MaxY             float32
	FromX, FromY     float32
	CtrlX, CtrlY     float32
	ToX, ToY         float32
}

const VertStride = 7*4 + 2*2

func init() {
	// Check that struct vertex has the expected size and
	// that it contains no padding.
	if unsafe.Sizeof(*(*Vertex)(nil)) != VertStride {
		panic("unexpected struct size")
	}
}