-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnanovgo+iconvg.go
128 lines (99 loc) · 2.77 KB
/
nanovgo+iconvg.go
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package contraption
import (
"github.com/neputevshina/contraption/nanovgo"
"golang.org/x/exp/shiny/iconvg"
)
type NanovgoDestination struct {
vg *nanovgo.Context
x, y float32
iconvg.Palette
}
func (n *NanovgoDestination) Reset(m iconvg.Metadata) {
n.vg.Reset()
n.Palette = m.Palette
n.vg.SetFillColor(hex(`#000000`))
}
func (n *NanovgoDestination) SetCSel(cSel uint8) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) SetNSel(nSel uint8) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) SetCReg(adj uint8, incr bool, c iconvg.Color) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) SetNReg(adj uint8, incr bool, f float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) SetLOD(lod0, lod1 float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) StartPath(adj uint8, x, y float32) {
n.vg.BeginPath()
n.vg.MoveTo(x, y)
}
func (n *NanovgoDestination) ClosePathEndPath() {
n.vg.ClosePath()
}
func (n *NanovgoDestination) ClosePathAbsMoveTo(x, y float32) {
n.x, n.y = x, y
n.vg.ClosePath()
n.vg.MoveTo(n.x, n.y)
}
func (n *NanovgoDestination) ClosePathRelMoveTo(x, y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsHLineTo(x float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) RelHLineTo(x float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsVLineTo(y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) RelVLineTo(y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsLineTo(x, y float32) {
n.x, n.y = x, y
n.vg.LineTo(n.x, n.y)
}
func (n *NanovgoDestination) RelLineTo(x, y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsSmoothQuadTo(x, y float32) {
n.vg.QuadTo(n.x, n.y, x, y)
n.x, n.y = x, y
}
func (n *NanovgoDestination) RelSmoothQuadTo(x, y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsQuadTo(x1, y1, x, y float32) {
n.vg.QuadTo(n.x, n.y, x, y)
n.x, n.y = x, y
}
func (n *NanovgoDestination) RelQuadTo(x1, y1, x, y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsSmoothCubeTo(x2, y2, x, y float32) {
n.vg.BezierTo(n.x, n.y, x2, y2, x, y)
n.x, n.y = x, y
}
func (n *NanovgoDestination) RelSmoothCubeTo(x2, y2, x, y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsCubeTo(x1, y1, x2, y2, x, y float32) {
n.vg.BezierTo(n.x, n.y, x2, y2, x, y)
n.x, n.y = x, y
}
func (n *NanovgoDestination) RelCubeTo(x1, y1, x2, y2, x, y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) AbsArcTo(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) {
panic(`unimplemented`)
}
func (n *NanovgoDestination) RelArcTo(rx, ry, xAxisRotation float32, largeArc, sweep bool, x, y float32) {
panic(`unimplemented`)
}
var _ iconvg.Destination = &NanovgoDestination{}