Class pwlib.tools.hand
The hand tool. This tool allows the user to drag the image canvas
inside the viewport.
Defined in: hand.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pwlib.tools.hand(app)
|
Field Attributes | Field Name and Description |
---|---|
<private> <inner> |
Tells if the viewport needs to be scrolled.
|
<private> |
Holds the previous tool ID.
|
<private> <inner> |
The interval ID used for invoking the viewport drag operation every few
milliseconds.
|
Method Attributes | Method Name and Description |
---|---|
activate()
Tool activation event handler.
|
|
deactivate(ev)
Tool deactivation event handler.
|
|
<inner> |
ev_mousemove(ev)
The
mousemove event handler. |
<inner> |
ev_mouseup(ev)
The
mouseup event handler. |
keydown(ev)
Allows the user to press Escape to stop dragging the canvas, and
to return to the previous tool.
|
|
mousedown(ev)
Initialize the canvas drag.
|
|
Tool preactivation event handler.
|
|
<inner> |
Perform the canvas drag operation.
|
Class Detail
pwlib.tools.hand(app)
- Parameters:
- {PaintWeb} app
- Reference to the main paint application object.
Field Detail
<private> <inner>
{Boolean}
needsScroll
Tells if the viewport needs to be scrolled.
- Default Value:
- false
<private>
{String}
prevTool
Holds the previous tool ID.
<private> <inner>
timer
The interval ID used for invoking the viewport drag operation every few
milliseconds.
- See:
- PaintWeb.config.toolDrawDelay
Method Detail
activate()
Tool activation event handler.
deactivate(ev)
Tool deactivation event handler.
- Parameters:
- ev
<inner>
ev_mousemove(ev)
The
mousemove
event handler. This simply stores the current
mouse location.
- Parameters:
- {Event} ev
- The DOM Event object.
<inner>
ev_mouseup(ev)
The
mouseup
event handler.
- Parameters:
- ev
{Boolean}
keydown(ev)
Allows the user to press Escape to stop dragging the canvas, and
to return to the previous tool.
- Parameters:
- {Event} ev
- The DOM Event object.
- Returns:
- {Boolean} True if the key was recognized, or false if not.
mousedown(ev)
Initialize the canvas drag.
- Parameters:
- {Event} ev
- The DOM event object.
{Boolean}
preActivate()
Tool preactivation event handler.
- Returns:
- {Boolean} True if the tool can become active, or false if not.
<inner>
viewportScroll()
Perform the canvas drag operation. This function is called every few
milliseconds.
Press Escape to stop dragging and to get back to the previous tool.