Class pwlib.tools.cbucket
The color bucket tool.
The implementation here is based on the seed fill algorithm of Paul S.
Heckbert (1990).
Defined in: cbucket.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pwlib.tools.cbucket(app)
|
Field Attributes | Field Name and Description |
---|---|
The
click and contextmenu event handler. |
Method Attributes | Method Name and Description |
---|---|
activate()
The
activate event handler. |
|
contextmenu(ev)
|
|
The
deactivate event handler. |
|
<private> <inner> |
fill(x, y)
Fill the image with the current fill color, starting from the x
and y coordinates.
|
<inner> |
pixelRead(x, y)
|
The
preActivate event handler. |
|
<inner> |
pushLine(y, xl, xr, dy)
|
Class Detail
pwlib.tools.cbucket(app)
- Parameters:
- {PaintWeb} app
- Reference to the main paint application object.
Field Detail
click
The
click
and contextmenu
event handler. This
method performs the flood fill operation.
Method Detail
activate()
The
activate
event handler. Canvas shadow rendering is
disabled.
contextmenu(ev)
- Parameters:
- ev
deactivate()
The
deactivate
event handler. Canvas shadow rendering is
allowed once again.
<private> <inner>
{Boolean}
fill(x, y)
Fill the image with the current fill color, starting from the x
and y coordinates.
- Parameters:
- {Number} x
- The x coordinate for the starting point.
- {Number} y
- The y coordinate for the starting point.
- Returns:
- {Boolean} True if the image was filled, or false otherwise.
<inner>
pixelRead(x, y)
- Parameters:
- x
- y
preActivate()
The
preActivate
event handler. This method checks if the
browser implements the getImageData()
and
putImageData()
context methods. If not, the color bucket tool
cannot be used.
<inner>
pushLine(y, xl, xr, dy)
- Parameters:
- y
- xl
- xr
- dy