Documentation
¶
Index ¶
- func BezierCurveSegment(p1, p2, p3, p4 *geo.Point, t0, t1 float64) (geo.Point, geo.Point, geo.Point, geo.Point)
- func EscapeText(text string) string
- func GetStrokeDashAttributes(strokeWidth, dashGapSize float64) (float64, float64)
- func SplitPath(path string, percentage float64) (string, string, error)
- type SvgPathContext
- func (c *SvgPathContext) Absolute(x, y float64) *geo.Point
- func (c *SvgPathContext) C(isLowerCase bool, x1, y1, x2, y2, x3, y3 float64)
- func (c *SvgPathContext) H(isLowerCase bool, x float64)
- func (c *SvgPathContext) L(isLowerCase bool, x, y float64)
- func (c *SvgPathContext) PathData() string
- func (c *SvgPathContext) Relative(base *geo.Point, dx, dy float64) *geo.Point
- func (c *SvgPathContext) StartAt(p *geo.Point)
- func (c *SvgPathContext) V(isLowerCase bool, y float64)
- func (c *SvgPathContext) Z()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BezierCurveSegment ¶ added in v0.6.6
func BezierCurveSegment(p1, p2, p3, p4 *geo.Point, t0, t1 float64) (geo.Point, geo.Point, geo.Point, geo.Point)
Given control points p1, p2, p3, p4, calculate the segment of this bezier curve from t0 -> t1 where {0 <= t0 < t1 <= 1}. Uses De Casteljau's algorithm, referenced: https://stackoverflow.com/questions/11703283/cubic-bezier-curve-segment/11704152#11704152
func EscapeText ¶ added in v0.1.3
func GetStrokeDashAttributes ¶ added in v0.1.3
Types ¶
type SvgPathContext ¶
type SvgPathContext struct { Path []geo.Intersectable Commands []string Start *geo.Point Current *geo.Point TopLeft *geo.Point ScaleX float64 ScaleY float64 }
func NewSVGPathContext ¶
func NewSVGPathContext(tl *geo.Point, sx, sy float64) *SvgPathContext
func (*SvgPathContext) C ¶
func (c *SvgPathContext) C(isLowerCase bool, x1, y1, x2, y2, x3, y3 float64)
func (*SvgPathContext) H ¶
func (c *SvgPathContext) H(isLowerCase bool, x float64)
func (*SvgPathContext) L ¶
func (c *SvgPathContext) L(isLowerCase bool, x, y float64)
func (*SvgPathContext) PathData ¶
func (c *SvgPathContext) PathData() string
func (*SvgPathContext) StartAt ¶
func (c *SvgPathContext) StartAt(p *geo.Point)
func (*SvgPathContext) V ¶
func (c *SvgPathContext) V(isLowerCase bool, y float64)
func (*SvgPathContext) Z ¶
func (c *SvgPathContext) Z()
Click to show internal directories.
Click to hide internal directories.