Floodfill

Floodfill painting tool.

Constructor

new Floodfill(app)

Parameters:
NameTypeDescription
appApp

The associated application.

Classes

Floodfill

Members

keydown

Handle key down event.

mousedown

Handle mouse down event.

mousemove

Handle mouse move event.

mouseout

Handle mouse out event.

mouseup

Handle mouse up event.

touchend

Handle touch end event.

touchmove

Handle touch move event.

touchstart

Handle touch start event.

Methods

activate(bool)

Activate the tool.

Parameters:
NameTypeDescription
boolboolean

The flag to activate or not.

addEventListener(type, callback)

Add an event listener to this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type, will be called with the fired event.

extend(ini, end, layerGroup)

Create Floodfill in all the prev and next slices while border is found.

Parameters:
NameTypeDescription
ininumber

The first slice to extend to.

endnumber

The last slice to extend to.

layerGroupobject

The origin layer group.

getEventNames() → {Array}

Get the list of event names that this tool can fire.

Returns:

The list of event names.

Type: 
Array

getExtend() → {boolean}

Get extend option for painting border on all slices.

Returns:

The actual value of of the variable to use Floodfill on museup.

Type: 
boolean

init()

Initialise the tool.

modifyThreshold(modifyThreshold, shape)

Modify tolerance threshold and redraw ROI.

Parameters:
NameTypeDescription
modifyThresholdnumber

The new threshold.

shapeobject

The shape to update.

onThresholdChange(_value)

Event fired when threshold change.

Parameters:
NameTypeDescription
_valuenumber

Current threshold.

removeEventListener(type, callback)

Remove an event listener from this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type.

setExtend(bool)

Set extend option for painting border on all slices.

Parameters:
NameTypeDescription
boolboolean

The option to set.

setFeatures(features)

Set the tool live features: shape colour.

Parameters:
NameTypeDescription
featuresobject

The list of features.