mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-07 20:34:14 +02:00
1e3c618495
A free text (IndependentTextItem) gets a textWidth property: -1 is the automatic width (one line, or lines broken by hand, as today); a positive width makes the text wrap between words. Its top-left corner stays in place. The property is what a spin box and resize handles will set in follow-up changes. File format: the width is saved as text_width on <input>, only when one is set, so a project without widths is saved byte-identical (tst_resaveunchanged). An older QElectroTech ignores the attribute and shows the text on one line, with no load error. DiagramTextItem::setHtml() no longer widens a centred or right-aligned rich text to idealWidth() + 40 when the text has a width of its own; with the automatic width it still does. Test: tst_freetextwidth (--resave keeps the width only where set, --export-svg draws the text wrapped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>