~eliasnaur/gio

ref: 1e38eec0abc1198e20d556f9f21345bf0114b211 gio/ui/internal/path/path.go -rw-r--r-- 516 bytes
1e38eec0Elias Naur ui: build paths as ops 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
// SPDX-License-Identifier: Unlicense OR MIT

package path

import (
	"unsafe"
)

// 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")
	}
}