bringToFront static method

Moves id to the front of its sibling stack.

Sibling order is paint order:

  • earlier siblings paint behind
  • later siblings paint in front

Implementation

static CanvasSceneDocument bringToFront(CanvasSceneDocument doc, NodeId id) {
  return _moveWithinCurrentParent(
    doc,
    id,
    targetIndexFor: (_, count) => count - 1,
  );
}