github.com/gop9/olt@v0.0.0-20200202132135-d956aad50b08/gio/internal/path/path.go (about) 1 // SPDX-License-Identifier: Unlicense OR MIT 2 3 package path 4 5 import ( 6 "unsafe" 7 ) 8 9 // The vertex data suitable for passing to vertex programs. 10 type Vertex struct { 11 CornerX, CornerY int16 12 MaxY float32 13 FromX, FromY float32 14 CtrlX, CtrlY float32 15 ToX, ToY float32 16 } 17 18 const VertStride = 7*4 + 2*2 19 20 func init() { 21 // Check that struct vertex has the expected size and 22 // that it contains no padding. 23 if unsafe.Sizeof(*(*Vertex)(nil)) != VertStride { 24 panic("unexpected struct size") 25 } 26 }