ShapeMixin.moveBefore

Moves this shape immediately before the given sibling in render order.

ShapeMixin.moveBefore() method

Moves this shape immediately before the given sibling in render order.

Signature:

moveBefore(sibling: Shape): void;

Parameters

Parameter

Type

Description

sibling

Shape

The shape to move this shape before.

Returns: void

Remarks

If sibling has a different parent (e.g. it lives in a different Group or ShapeLayer), this shape is reparented to the sibling's parent as part of the move.

Example

const [first, second] = group.shapes;
second.moveBefore(first);
Last updated: August 5, 2026 at 11:47 AMEdit this page