Library globals

Class globals . canvas . api . element . Element

View source

-------------------------------------------------------------------------------
canvas.Element
-------------------------------------------------------------------------------
Baseclass for all elements on a canvas

Functions

boundingbox2clip

convert bounding box vector into clip string (yes, different order)

createTransform

Create a new transformation matrix @param vals Default values (Vector of 6 elements)

equals

Check if elements represent same instance @param el Other Element or element ghost

getCanvas

Get the canvas this element is placed on

getCenter

Get transformation center

getColorFill

getParent

Get parent group/element

getScale

Shortcut for getting scale

getSize

return vector [sx, sy] with dimensions of bounding box

getTransformedBounds

getTranslation

Get translation set with #setTranslation

getType

getVisible

hide

Hide element (Shortcut for setVisible(0))

new

Constructor @param ghost Element ghost as retrieved from core methods

setCenter

Set transformation center (currently only used for rotation)

setClipByBoundingBox

set clip by bounding box bounding_box: [xmin, ymin, xmax, ymax]

setClipByElement

set clipping by bounding box of another element

setColorFill

Set the fill/background/boundingbox color @param color Vector of 3 or 4 values in [0, 1]

setGeoPosition

setRotation

Set rotation around transformation center (see #setCenter). @note This replaces the the existing transformation. For additional scale or translation use additional transforms (see #createTransform).

setScale

Shortcut for setting scale

setTranslation

Shortcut for setting translation

setVisible

Hide/Show element @param visible Whether the element should be visible

show

Show element (Shortcut for setVisible(1))

toggleVisibility

Toggle element visibility

updateCenter

Calculate the transformation center based on bounding box and center-offset

Variables

GLOBAL

Reference frames (for "clip" coordinates)

LOCAL

PARENT