Repository navigation
Conversation
Left/Center/Right edges, Distribute, Set spacing, Current vertical and Current horizontal modes; edges come from the rendered glyph ink. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks @insanedps. Closing as superseded: #2188 implemented TEXTALIGN with all 12 alignments and localized prompts, building on the same idea. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2144.
What
New command
TEXTALIGN: aligns and spaces several TEXT, MTEXT and ATTDEF objects against a base text, following the AutoCAD prompts:.pgpalias that pointed atTEXTALIGNnow resolves to it.How
wire_models_for→text_verts), measured in the text's own frame. Each SDF glyph tile is the glyph's ink box plusSPREAD_UNITS(nowpub(crate)insdf_atlas.rs), so the margin is subtracted to get the ink edge, the same measure astext_local_bounds. The ink box is then mapped back to world axes, so rotated text aligns by its world-axis box.src/modules/draw/modify/textalign.rs; dispatch insrc/app/commands/draw.rs.Known limits
Tests
11 tests: left, right and centre edges against the glyph ink, justified TEXT moving both points, MTEXT and rotated TEXT/ATTDEF, distribute, set spacing, horizontal mode, rejecting a second point straight across the spacing axis, prompts resolving to text, and one undo restoring every position in model space and in a paper layout through the
.pgpalias. Each test fails with its part of the code turned off. Fullcargo test --lib: 3164 passed, 0 failed, 32 ignored.