Codebase
SDK

Frames

How frames and their children are ordered and handled in the scene.

Ordering

Frames should be ordered where frame children come first, followed by the frame element itself:

[
  other_element,
  frame1_child1,
  frame1_child2,
  frame1,
  other_element,
  frame2_child1,
  frame2_child2,
  frame2,
  other_element,
  ...
]

If not ordered correctly, the editor will still function, but the elements may not be rendered and clipped correctly. Further, the renderer relies on this ordering for performance optimizations.

Clipping

Frame children are clipped to their frame, and can't be hit (selected, hovered, box- or lasso-selected) outside of it.

Arrows (with their labels) are the exception: they're never clipped, so that they can connect elements across and out of frames. They still belong to the frame they're drawn from, so they're moved, copied and deleted with it, but only while one of their ends is in it: bound to an element in the frame, or, unbound, inside it (see removeArrowsWithoutEndInFrame). An arrow bound only to elements outside the frame thus leaves it. When exporting a frame, arrows of other frames reaching into it are exported too, as are any other non-children overlapping it. When moving a frame (dragging it, with the arrow keys, or from the stats panel), its arrows bound to elements that don't move with it stay bound to them (see moveFrameArrows).

Last updated on

On this page