active([active])

Class: Shape.

Description:

Sets or gets whether this shape is active (true by default).

An inactive shape (active(false)) does not produce events mousedown, mouseup, click, mouseenter, mouseleave, mousemove on Panel > onShapeEvents, and is skipped during mouse hit-testing. This means the mouse "passes through" the shape as if it weren't there — if another shape lies beneath it, that shape is considered to be under the mouse instead.

Settings active to false may be useful for purely decorative shapes (e.g. background fills, watermarks, static overlays) that shouldn't intercept or respond to mouse interaction.

Parameters:

Name Type Description

[active]

boolean

false to make the shape inactive (ignored by shape events and mouse hit-testing), true to restore normal behavior. Omit to get the current value.

Returns:

When called without arguments, returns the current value; otherwise returns this Shape instance for method chaining.

Type: boolean | Shape

Also See: