Interface LayerPosition

Positioning of a layer within its container (the Dmd, or a parent LayerGroup).

interface LayerPosition {
    top?: number;
    left?: number;
    hAlign?: HAlign | "constraint";
    vAlign?: VAlign | "constraint";
    hOffset?: number;
    vOffset?: number;
    leftToLeftOf?: string;
    leftToRightOf?: string;
    leftToCenterOf?: string;
    rightToLeftOf?: string;
    rightToRightOf?: string;
    rightToCenterOf?: string;
    hCenterToLeftOf?: string;
    hCenterToCenterOf?: string;
    hCenterToRightOf?: string;
    topToTopOf?: string;
    topToBottomOf?: string;
    topToCenterOf?: string;
    bottomToTopOf?: string;
    bottomToBottomOf?: string;
    bottomToCenterOf?: string;
    vCenterToTopOf?: string;
    vCenterToCenterOf?: string;
    vCenterToBottomOf?: string;
}

Properties

top?: number

Top position in pixels. Default: 0.

left?: number

Left position in pixels. Default: 0.

hAlign?: HAlign | "constraint"

Horizontal alignment within the container. 'constraint' opts into aligning against a sibling instead - see the *To*Of fields below.

vAlign?: VAlign | "constraint"

Vertical alignment within the container. 'constraint' opts into aligning against a sibling instead - see the *To*Of fields below.

hOffset?: number

Horizontal pixel offset (added after alignment). Default: 0.

vOffset?: number

Vertical pixel offset (added after alignment). Default: 0.

leftToLeftOf?: string

Only read when hAlign is 'constraint'. Exactly one of the nine *To*Of fields below should be set; its value is either a sibling layer's id (a layer already added to the same container - the Dmd, or the same parent LayerGroup) or the literal 'parent' for the container itself. If the referenced id doesn't exist, falls back to 'parent' and logs a console warning.

My left edge aligns to the target's left edge.

leftToRightOf?: string

My left edge aligns to the target's right edge.

leftToCenterOf?: string

My left edge aligns to the target's horizontal center.

rightToLeftOf?: string

My right edge aligns to the target's left edge.

rightToRightOf?: string

My right edge aligns to the target's right edge.

rightToCenterOf?: string

My right edge aligns to the target's horizontal center.

hCenterToLeftOf?: string

My horizontal center aligns to the target's left edge.

hCenterToCenterOf?: string

My horizontal center aligns to the target's horizontal center.

hCenterToRightOf?: string

My horizontal center aligns to the target's right edge.

topToTopOf?: string

Only read when vAlign is 'constraint'. Exactly one of the nine *To*Of fields below should be set; same target semantics as the horizontal fields above.

My top edge aligns to the target's top edge.

topToBottomOf?: string

My top edge aligns to the target's bottom edge.

topToCenterOf?: string

My top edge aligns to the target's vertical center.

bottomToTopOf?: string

My bottom edge aligns to the target's top edge.

bottomToBottomOf?: string

My bottom edge aligns to the target's bottom edge.

bottomToCenterOf?: string

My bottom edge aligns to the target's vertical center.

vCenterToTopOf?: string

My vertical center aligns to the target's top edge.

vCenterToCenterOf?: string

My vertical center aligns to the target's vertical center.

vCenterToBottomOf?: string

My vertical center aligns to the target's bottom edge.