Class PaintTools.rect
The rectangle tool.
Defined in: tools.js.
Constructor Attributes | Constructor Name and Description |
---|---|
PaintTools.rect(app)
|
Field Attributes | Field Name and Description |
---|---|
<private> <inner> |
Holds the starting point on the x axis of the image, for the
current drawing operation.
|
<private> <inner> |
Holds the starting point on the y axis of the image, for the
current drawing operation.
|
Method Attributes | Method Name and Description |
---|---|
keydown(ev)
Allows the user to press Escape to cancel the drawing operation.
|
|
mousedown(ev)
Initialize the drawing operation, by storing the location of the pointer,
the start position.
|
|
mousemove(ev)
Perform the drawing operation, while the user moves the mouse.
|
|
mouseup(ev)
End the drawing operation, once the user releases the mouse button.
|
Class Detail
PaintTools.rect(app)
- Parameters:
- {Painter} app
- Reference to the main paint application object.
Field Detail
<private> <inner>
{Number}
x0
Holds the starting point on the x axis of the image, for the
current drawing operation.
<private> <inner>
{Number}
y0
Holds the starting point on the y axis of the image, for the
current drawing operation.
Method Detail
{Boolean}
keydown(ev)
Allows the user to press Escape to cancel the drawing operation.
- Parameters:
- {Event} ev
- The DOM Event object.
- Returns:
- {Boolean} True if the drawing operation was cancelled, or false if not.
mousedown(ev)
Initialize the drawing operation, by storing the location of the pointer,
the start position.
- Parameters:
- {Event} ev
- The DOM Event object.
mousemove(ev)
Perform the drawing operation, while the user moves the mouse.
Hold down the Shift key to draw a square.
Press Escape to cancel the drawing operation.
- Parameters:
- {Event} ev
- The DOM Event object.
mouseup(ev)
End the drawing operation, once the user releases the mouse button.
- Parameters:
- {Event} ev
- The DOM Event object.