mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-10 06:04:12 +02:00
36df4b3010
A symbol text on a folio with its width on "Auto" kept every line of a multi-line text on the left, whatever its alignment: a QTextDocument with no text width has no width to centre or right-align lines in. It only worked once the user gave the text a width wide enough. With the width on Auto and a centre or right alignment, give the document the width of its longest line. The size of the text does not change, only where the shorter lines sit. The fit is redone when the text, the alignment, the width or the font changes; on a font change the text's anchor is kept, as the font change itself does. textWidth() now returns the width the user set (-1 for Auto), the value that is saved, rather than the document's, as IndependentTextItem already does. Readers (properties panel, resize-handle undo, script API, project database) see -1 for Auto as before. Checked: every folio of the 25 example projects renders identically to master (136 PNGs); a centred and a right-aligned two-line text now render aligned; changing their font size leaves the same box and anchor as master, and without the font-change refit the lines wrap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>