Object Transforms

Overview

Use the transform APIs to move, rotate, or scale multiple objects in one call. These operations create standard history entries just like interactive transforms.

Move Objects

editor.moveObjects([idA, idB], 12, -8)
  • Applies a delta to each object's position.

Rotate Objects

editor.rotateObjects([idA, idB], 45, { x: 200, y: 150 })
  • angle is in degrees.
  • Provide center to rotate around a specific point.

Interactive Rotation Handles

  • Rotation hit areas are computed from each node's local (untransformed) bounds.
  • For center-origin shapes (for example circle and ellipse), the handles are still placed outside the four visual bounding corners.
  • Handle size and offset stay consistent on screen while zooming.

Resizing Rotated Rectangles

  • When resizing a rotated rectangle from an edge or corner handle, the opposite anchor stays fixed in the rotated coordinate space.
  • Middle-edge resize (middle-left / middle-right / top-center / bottom-center) changes only one dimension while preserving the opposite edge position.
  • The fixed-anchor behavior is applied continuously during transform updates, not only at transform end.
  • Resize handle cursors rotate with the object so edge-handle cursor direction stays perpendicular to the active edge.

Scale Objects

editor.scaleObjects([idA, idB], 1.5, 0.75, { x: 200, y: 150 })
  • scaleX / scaleY are multiplicative factors.
  • Provide center to scale around a specific point.

Notes

  • If an ID is missing, that object is skipped.
  • Passing a scale factor of 0 is ignored.