Class Line
Defined in: primitives.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Line(startPoint, endPoint)
Creates an instance of a Line
|
Field Attributes | Field Name and Description |
---|---|
Ending Point of the line
|
|
Serialization type
|
|
Starting Point of the line
|
|
The Style of the line
|
Method Attributes | Method Name and Description |
---|---|
clone()
|
|
contains(x, y)
Tests to see if a point belongs to this line (not as infinite line but more like a segment)
Algorithm: Compute line's equation and see if (x, y) verifies it.
|
|
equals(anotherLine)
|
|
Get bounds for this line
|
|
we need to create a new array each time, or we will affect the actual shape
|
|
<static> |
Line.load(o)
Creates a {Line} out of JSON parsed object
|
near(x, y, radius)
|
|
paint(context)
|
|
toString()
String representation
|
|
toSVG()
Render the SVG fragment for this primitive
|
|
transform(matrix)
|
Field Detail
endPoint
Ending Point of the line
oType
Serialization type
startPoint
Starting Point of the line
style
The Style of the line
Method Detail
clone()
contains(x, y)
Tests to see if a point belongs to this line (not as infinite line but more like a segment)
Algorithm: Compute line's equation and see if (x, y) verifies it.
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {Number} x
- - the X coordinates
- {Number} y
- - the Y coordinates
equals(anotherLine)
- Parameters:
- anotherLine
getBounds()
Get bounds for this line
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
getPoints()
we need to create a new array each time, or we will affect the actual shape
<static>
{Line}
Line.load(o)
Creates a {Line} out of JSON parsed object
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {JSONObject} o
- - the JSON parsed object
- Returns:
- {Line} a newly constructed Line
near(x, y, radius)
- Parameters:
- x
- y
- radius
paint(context)
- Parameters:
- context
toString()
String representation
toSVG()
Render the SVG fragment for this primitive
transform(matrix)
- Parameters:
- matrix