mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 10:37:03 -06:00
anchorCtr's centreing offset was computed for a block that starts at the box's left edge and then added to lines that alignment had already placed within the box. For a right-aligned line the two shifts stacked: the line ended up starting at the box's centre and ran past the right edge - on the tdf165341 fixture the sentence was cut off at "...paragraph rig". The clamp at zero made it worse for content wider than the box: all the overflow went to the right only. The origin is now set so the drawn text block's own centre (min/max of the laid-out line extents) lands on the box's centre: every alignment stays inside the box when it fits, and overflow centres symmetrically past both edges, as PowerPoint draws it. Empty lines carry no ink and stay out of the block; vertical text and multi-column bodies are unchanged (centring is unimplemented for them, as before). Tests: right/left-aligned, trailing empty paragraph, mixed alignment, symmetric overflow, and a no-anchorCtr control - the block's centre equals the box's centre in every case. Reported with a public LibreOffice test fixture (tdf165341.pptx); verified by rendering the slide before (text cut at the right edge) and after (whole sentence centred).