Constructor
new Line()
- Description:
- Source:
Properties:
Name |
Type |
Attributes |
Default |
Description |
start |
Point
|
|
|
Start X & Y axis coordinates |
end |
Point
|
|
|
End X & Y axis coordinates |
stroke |
Stroke
|
|
|
Stroke properties |
shadow |
Shadow
|
|
|
Shadow properties |
lineCap |
string
|
<optional>
|
'round'
|
Line cap's end points shape |
canvas |
HTMLCanvasElement
|
|
|
2D canvas context |
controlPoints |
ControlPoints
|
|
|
Control point properties |
options |
Options
|
|
|
Options for this object |
position |
Position
|
|
|
Position properties |
Methods
canvas(value)
- Description:
- Source:
- See:
-
Parameters:
Name |
Type |
Description |
value |
string
|
Canvas id |
canvas() → {string}
- Description:
- Source:
- See:
-
Returns:
Canvas id
-
Type
-
string
center() → {Point}
- Description:
- Get center of this object
- Source:
Returns:
Center point coordinates
-
Type
-
Point
- Description:
- Get control point properties
- Source:
Returns:
Control points properties
-
Type
-
ControlPoints
curve(p0, p1, p2, p3)
- Description:
- Set control points for bezier curve
- Source:
Parameters:
Name |
Type |
Description |
p0 |
number
|
Control point 0 |
p1 |
number
|
Control point 1 |
p2 |
number
|
Control point 2 |
p3 |
number
|
Control point 3 |
draw(canvas)
- Description:
- Source:
Parameters:
Name |
Type |
Description |
canvas |
string
|
Canvas Id |
drawPoints()
- Description:
- Source:
end(value)
- Description:
- Source:
Parameters:
Name |
Type |
Description |
value |
Point
|
Ending point |
- Description:
- Source:
Returns:
Ending point
-
Type
-
Point
isThere(line)
- Description:
- Check whether the passed object is already present
- Source:
Parameters:
Name |
Type |
Description |
line |
Line
|
Object to validate |
lineCap(value)
- Description:
- Source:
Parameters:
Name |
Type |
Description |
value |
string
|
Line cap |
lineCap() → {string}
- Description:
- Source:
Returns:
Line cap
-
Type
-
string
move(degree, distance)
- Description:
- Source:
Parameters:
Name |
Type |
Description |
degree |
number
|
Direction to move; in degrees |
distance |
number
|
Distance to move |
- Description:
- Source:
Returns:
Options properties
-
Type
-
Options
- Description:
- Source:
Returns:
Position properties
-
Type
-
Position
rotate(degree, anchoropt)
- Description:
- Source:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
degree |
number
|
|
|
Distance to rotate; in degrees |
anchor |
string
|
<optional>
|
'center'
|
Anchoring point during rotation |
shadow() → {Shadow}
- Description:
- Source:
Returns:
Shadow properties
-
Type
-
Shadow
showControlPoints(offsetopt, fontSizeopt)
- Description:
- Show control points for this object
- Source:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
offset |
number
|
<optional>
|
10
|
Offset of control points y origin |
fontSize |
number
|
<optional>
|
16
|
Control points font size |
showCoordinates(offsetopt, fontSizeopt)
- Description:
- Shows coordinates of this object
- Source:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
offset |
number
|
<optional>
|
10
|
Offset of coordinates y origin |
fontSize |
number
|
<optional>
|
16
|
Coordinates font size |
start(value)
- Description:
- Source:
Parameters:
Name |
Type |
Description |
value |
Point
|
Starting point |
start() → {Point}
- Description:
- Source:
Returns:
Starting point
-
Type
-
Point
stroke() → {Stroke}
- Description:
- Source:
Returns:
Stroke properties
-
Type
-
Stroke