Class Path
Defined in: primitives.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Path()
A path contains a number of elements (like shape) but they are drawn as one, i.e.
|
Field Attributes | Field Name and Description |
---|---|
Object type used for JSON deserialization
|
|
An {Array} that will store all the basic primitives: Points, Lines, CubicCurves, etc that make the path
|
|
The Style used for drawing
|
Method Attributes | Method Name and Description |
---|---|
addPrimitive(primitive)
|
|
clone()
|
|
contains(x, y)
|
|
equals(anotherPath)
|
|
<static> |
Path.load(o)
Creates a new {Path} out of JSON parsed object
|
near(x, y, radius)
|
|
paint(context)
|
|
toSVG()
Export this path to SVG
|
|
transform(matrix)
|
Class Detail
Path()
A path contains a number of elements (like shape) but they are drawn as one, i.e.
begin path loop to draw shapes draw shape close loop close path
Field Detail
oType
Object type used for JSON deserialization
primitives
An {Array} that will store all the basic primitives: Points, Lines, CubicCurves, etc that make the path
style
The Style used for drawing
Method Detail
addPrimitive(primitive)
- Parameters:
- primitive
clone()
contains(x, y)
- Parameters:
- x
- y
equals(anotherPath)
- Parameters:
- anotherPath
getBounds()
getPoints()
<static>
{Path}
Path.load(o)
Creates a new {Path} out of JSON parsed object
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {JSONObject} o
- - the JSON parsed object
- Returns:
- {Path} a newly constructed {Path}
near(x, y, radius)
- Parameters:
- x
- y
- radius
paint(context)
- Parameters:
- context
toSVG()
Export this path to SVG
<path d="M50,50 A30,30 0 0,1 35,20 L100,100 M110,110 L100,0" style="stroke:#660000; fill:none;"/>
transform(matrix)
- Parameters:
- matrix