Files
next-ai-draw-io/lib/diagram-engine/render.ts
dayuan.jiang 8687e8f04b fix(diagram-engine): slack packs to column top; paragraphs set flush-left
The poster's two ugliest defects were engine policy, not model declarations:

- A column stretched by its siblings distributed the slack into gaps (and,
  via grow, into boxes), producing huge panels with three lines floating in
  the middle. Slack policy now differs by axis: a ROW still spreads and
  centres (a flowchart layer reads as a pyramid), a COLUMN packs to the top
  and leaves leftover space at the bottom — where a reader expects it.
- Multi-line body text rendered dead-centre (FALLBACK_BOX's
  verticalAlign=middle). Typography's basic rule, applied by content: a
  paragraph (explicit breaks or wrap-length text) sets align=left,
  verticalAlign=top with padding; a short label stays centred. Rectangles
  only — inside a rhombus or cloud the safe text area IS the middle.
- Prompts corrected: stretch is about width, content keeps natural height,
  and columns are balanced by moving content — not by inflating boxes.

565 tests green; the same poster declaration re-rendered without the giant
hollow panels.
2026-08-09 22:22:08 +09:00

39 KiB