Documentation
¶
Index ¶
- type Circle
- type ColorAttributes
- type Ellipse
- type Image
- type Path
- type PathCommand
- type PathCommandArc
- type PathCommandCubicBezier
- type PathCommandCubicBezierShortcut
- type PathCommandH
- type PathCommandKind
- type PathCommandLineTo
- type PathCommandMoveTo
- type PathCommandQuadraticBezier
- type PathCommandQuadraticBezierShortcut
- type PathCommandV
- type PathCommandZ
- type PathState
- type Shape
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorAttributes ¶
type Path ¶
type Path struct {
Commands []PathCommand
}
type PathCommand ¶
type PathCommand struct { MoveTo *PathCommandMoveTo `json:",omitempty"` // Mm LineTo *PathCommandLineTo `json:",omitempty"` // Ll H *PathCommandH `json:",omitempty"` // Hh V *PathCommandV `json:",omitempty"` // Vv Z *PathCommandZ `json:",omitempty"` // Zz CubicBezier *PathCommandCubicBezier `json:",omitempty"` // Cc CubicBezierShortcut *PathCommandCubicBezierShortcut `json:",omitempty"` // Ss QuadraticBezier *PathCommandQuadraticBezier `json:",omitempty"` // Qq QuadraticBezierShortcut *PathCommandQuadraticBezierShortcut `json:",omitempty"` // Tt Arc *PathCommandArc `json:",omitempty"` // Aa }
PathCommand is an SVG path command
func (*PathCommand) Kind ¶
func (c *PathCommand) Kind() PathCommandKind
Kind returns the command's kind
type PathCommandArc ¶
type PathCommandArc struct { Upper bool Rx, Ry, XAxisRotation, LargeArcFlag, SweepFlag, X, Y float64 }
PathCommandArc is the A/a SVG path command
type PathCommandCubicBezier ¶
PathCommandCubicBezier is the C/c SVG path command
type PathCommandCubicBezierShortcut ¶
PathCommandCubicBezierShortcut is the S/s SVG path command
type PathCommandH ¶
PathCommandH is the H/h SVG path command
type PathCommandKind ¶
type PathCommandKind commandKind
PathCommandKind is a SVG path command kind
const ( PathCommandKindMoveTo PathCommandKind = "M" PathCommandKindLineTo PathCommandKind = "L" PathCommandKindH PathCommandKind = "H" PathCommandKindV PathCommandKind = "V" PathCommandKindZ PathCommandKind = "Z" PathCommandKindCubicBezier PathCommandKind = "C" PathCommandKindCubicBezierShortcut PathCommandKind = "S" PathCommandKindQuadraticBezier PathCommandKind = "Q" PathCommandKindQuadraticBezierShortcut PathCommandKind = "T" PathCommandKindArc PathCommandKind = "A" )
All supported command kinds
type PathCommandLineTo ¶
PathCommandLineTo is the L/l SVG path command
type PathCommandMoveTo ¶
PathCommandMoveTo is the M/m SVG path command
type PathCommandQuadraticBezier ¶
PathCommandQuadraticBezier is the Q/q SVG path command
type PathCommandQuadraticBezierShortcut ¶
PathCommandQuadraticBezierShortcut is the T/t SVG path command
type PathCommandV ¶
PathCommandV is the V/v SVG path command
type PathCommandZ ¶
type PathCommandZ struct {
Upper bool
}
PathCommandZ is the Z/z SVG path command
type PathState ¶
type PathState struct { CurrentPosition geom.Point Positions []geom.Point LastCommand PathCommand }
PathState is a path interpreter state
func (*PathState) Command ¶
func (state *PathState) Command(c PathCommand) (upper PathCommand, pos geom.Point)
Command updates the state by executing the given command