utils

package
v0.0.0-...-908ea3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Symbol string
	Params []float64
}

Command is a representation of an SVG path command and its parameters.

func (*Command) Compare

func (c *Command) Compare(o *Command) bool

Compare compares two commands.

func (*Command) IsAbsolute

func (c *Command) IsAbsolute() bool

IsAbsolute returns true is the SVG path command is absolute.

type Path

type Path struct {
	Subpaths []*Subpath
}

Path is a collection of all the subpaths in 'd' attribute.

func PathParser

func PathParser(raw string) (*Path, error)

PathParser takes value of a 'd' attribute and transforms it to collection of subpaths and commands.

func (*Path) Compare

func (p *Path) Compare(o *Path) bool

Compare compares two paths.

type PathParserError

type PathParserError struct {
	// contains filtered or unexported fields
}

PathParserError contains errors which have occured when parsing 'd' attribute of a path element.

func (PathParserError) Error

func (err PathParserError) Error() string

type Style

type Style struct {
	Property string
	Value    string
}

Style represents a CSS style property and its value.

type Styles

type Styles []*Style

Styles is a collection of Style objects.

func StyleParser

func StyleParser(raw string) Styles

StyleParser takes value of a style attribute and converts it to Style objects.

func (Styles) Compare

func (ss Styles) Compare(o Styles) bool

Compare compares two Style objects.

type Subpath

type Subpath struct {
	Commands []*Command
}

Subpath is a collection of Commands, beginning with moveto command and usually ending with closepath command.

func (*Subpath) Compare

func (s *Subpath) Compare(o *Subpath) bool

Compare compares two subpaths.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL