mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-26 19:37:03 -06:00
* Tight and Through wrapping follow the object's outline (#354) Text now wraps around a Tight or Through object's shape instead of its bounding box. The outline is the object's wrap polygon (wp:wrapPolygon, in the 21600-unit space of its frame) when it has one; otherwise it is derived: a shape's geometry (ellipse, triangle, star, heart... flattened), the convex hull of a picture's opaque pixels (alpha threshold on a coarse grid, at most 64 points), or the rectangle. The outline turns and flips with the object, keeps the left/right and top/bottom distances from text, and is built once per placed object; each line asks it which stretches of its band it covers. Through also lets text into gaps inside the outline that are wide enough. DOCX reads and writes wp:wrapPolygon (with edited) for wrapTight and wrapThrough; a shape without one gets its outline written, other objects their rectangle, since the schema requires a polygon. Square, top and bottom, behind and in front of text are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Choose which side of an object text wraps on (#354) Square, Tight and Through objects now have a wrap side, like Word's "Wrap text" choice: both sides (the default), left only, right only, or the largest side. Left keeps the band to the object's right empty on every line beside it, Right the band to its left, and Largest picks the wider side line by line. It works with contour wrapping and with turned objects, and right-to-left paragraphs mirror it. The setting is Float::wrap_text, read from and written to wrapText on wp:wrapSquare, wp:wrapTight and wp:wrapThrough (previously always written as bothSides). The new arrange.wrapText command {"side": "bothSides|left|right|largest"} sets it on the selected object as one undo step. The ribbon's Wrap Text button is now a menu with the wrap styles and a Wrap Text Sides submenu, translated in every interface language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Brandon Thomas <echelon@gmail.com>