Documentation is work in progress and not completeEditor
FlashCC/The canvas/Section 9 of 29

Changing format (reflow)

Why proportional scaling is the wrong answer to a format change, and the split rule reflow.ts uses instead.

The old setFormat changed width/height and left every layer at its pixel position, so 4:5 → 9:16 stranded the content in the top two-thirds. Proportional scaling — Magic Resize’s approach — is the other wrong answer: it squashes type and turns circles into ovals.

The split rule

  • •Horizontal follows the board.
  • •Vertical position follows the board, so a block that sat low still sits low.
  • •Vertical size does not stretch. Text keeps its point size, is re-wrapped to the new column, and its box is re-measured from the lines it actually needs.
  • •Full-bleed layers (≥98% of the board) re-cover exactly.
  • •Non-text layers scale by min(sx, sy), which is what keeps circles circular.

It re-lays the layers that are there rather than regenerating from source text. Regenerating is easier and silently deletes every hand-drawn shape, moved block and placed image.

verticalFill exists purely for the tests: "everything is inside the artboard" passes for the broken version too, because stranded content overflows nothing.