forked from rustyoz/svg
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdrawinginstruction.go
More file actions
40 lines (36 loc) · 997 Bytes
/
drawinginstruction.go
File metadata and controls
40 lines (36 loc) · 997 Bytes
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
package svg
// InstructionType tells our path drawing library which function it has
// to call
type InstructionType int
// These are instruction types that we use with our path drawing library
const (
MoveInstruction InstructionType = iota
CircleInstruction
CurveInstruction
LineInstruction
HLineInstruction
CloseInstruction
PaintInstruction
)
// CurvePoints are the points needed by a bezier curve.
type CurvePoints struct {
C1 *Tuple
C2 *Tuple
T *Tuple
}
// DrawingInstruction contains enough information that a simple drawing
// library can draw the shapes contained in an SVG file.
//
// The struct contains all necessary fields but only the ones needed (as
// indicated byt the InstructionType) will be non-nil.
type DrawingInstruction struct {
Kind InstructionType
M *Tuple
CurvePoints *CurvePoints
Radius *float64
StrokeWidth *float64
Fill *string
Stroke *string
StrokeLineCap *string
StrokeLineJoin *string
}