Class pwlib.tools.bcurve
The Bézier curve tool.
Defined in: bcurve.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pwlib.tools.bcurve(app)
|
Field Attributes | Field Name and Description |
---|---|
<private> <inner> |
Tells if the drawing canvas needs to be updated or not.
|
<private> <inner> |
Holds the points in the Bézier curve being drawn.
|
<private> <inner> |
Tells if the Shift key is down or not.
|
<private> <inner> |
The interval ID used for invoking the drawing operation every few
milliseconds.
|
Method Attributes | Method Name and Description |
---|---|
The tool deactivation method, used for clearing the buffer.
|
|
draw()
Draw the Bézier curve, using the available points.
|
|
keydown(ev)
The
keydown event handler. |
|
mousedown(ev)
The
mousedown event handler. |
|
mousemove(ev)
Store the Shift key state which is used by the drawing function.
|
|
mouseup(ev)
The
mouseup event handler. |
Class Detail
pwlib.tools.bcurve(app)
- Parameters:
- {PaintWeb} app
- Reference to the main paint application object.
Field Detail
<private> <inner>
{Boolean}
needsRedraw
Tells if the drawing canvas needs to be updated or not.
- Default Value:
- false
<private> <inner>
{Array}
points
Holds the points in the Bézier curve being drawn.
<private> <inner>
{Boolean}
shiftKey
Tells if the Shift key is down or not. This is used by the
drawing function.
- Default Value:
- false
<private> <inner>
timer
The interval ID used for invoking the drawing operation every few
milliseconds.
- See:
- PaintWeb.config.toolDrawDelay
Method Detail
deactivate()
The tool deactivation method, used for clearing the buffer.
draw()
Draw the Bézier curve, using the available points.
- See:
- PaintWeb.config.toolDrawDelay
{Boolean}
keydown(ev)
The
keydown
event handler. This method allows the user to
press the Escape key to cancel the current drawing operation.
- Parameters:
- {Event} ev
- The DOM Event object.
- Returns:
- {Boolean} True if the keyboard shortcut was recognized, or false if not.
mousedown(ev)
The
mousedown
event handler.
- Parameters:
- {Event} ev
- The DOM Event object.
mousemove(ev)
Store the Shift key state which is used by the drawing function.
- Parameters:
- {Event} ev
- The DOM Event object.
mouseup(ev)
The
mouseup
event handler. This method stores the current
mouse coordinates as a point to be used for drawing the Bézier curve.
- Parameters:
- {Event} ev
- The DOM Event object.