Sketcher: support text boxes in array tools - #399
Merged
Merged
Conversation
Array templates can now be text boxes. Copies are baked without stale construction-line references (their fourth frame corner follows from the parallelogram identity), so they render and hit-test correctly and cannot be cascade-deleted with the template's helpers. The text box geometry signature now covers content and font, so editing the template's text or font re-derives every copy on the next solve; in-place copy updates re-derive content, font and fill from the template. Entity group previews sample multi-contour entities into one polyline per contour, so the array dialog preview shows the full glyph outlines instead of only the first contour. Requires the FontConfig copy-protocol fix in raygeo (PR barebaric/raygeo#29); deep-copying a text box raises TypeError against older raygeo builds.
Narrows optional registry lookups and uses SketchSelection so pyright passes on the new test module, and skips the text-array tests when the installed raygeo build predates the FontConfig copy protocol (barebaric/raygeo#29) instead of failing on the deepcopy TypeError.
Replaces the isinstance dispatch in CreateArrayCommand with an Entity.clear_helper_references override: entities with helper geometry (ellipse helper lines, text box construction lines) clear their own references; the base is a no-op.
This was referenced Sep 11, 2026
raygeo 1.52.0 ships the FontConfig copy protocol (barebaric/raygeo#29, released as v1.52.0). Pin it in requirements.txt, pixi.toml, the debian bundle requirements and pixi.lock, and remove the _fontconfig_is_copyable skipif guard from the text array tests so they always run.
…ext-boxes # Conflicts: # debian/requirements-bundle.txt # pixi.lock # pixi.toml # requirements.txt
A text box exposes only its three defining frame points; its fourth corner is referenced solely by its construction lines (helper geometry). Every rigid motion of an array member built its group from the member entities alone, leaving the corner behind: during a guide drag the template's ParallelogramConstraint stayed violated (the corner lagged), and the drag-end global solve repaired it by dragging and rotating the whole box. Move helper geometry with the member in every array motion: template placement (create/redo), curve re-anchor, circular translate and radial re-projection, plus undo snapshots. Standalone-point discovery now includes helpers, matching creation, so the corner is not double-tracked.
This branch was successfully deployed
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.
Addresses the circular-array part of #358.
Summary
Text boxes can now be used as array templates (Circular Array and Array Along Curve share the machinery):
create_array.py): baked copies no longer inherit the template'sconstruction_line_ids(same treatment as ellipse helper lines). A copy's fourth frame corner falls back to the parallelogram identity, so copies render and hit-test correctly and can't be cascade-deleted together with the template's helpers.text_box.py): the text boxgeometry_signaturenow covers content and font, so editing the template's text or font re-derives every copy on the next solve. In-place copy updates (rewrite_offsets_from) re-derive content, font and fill from the template.entity.py,entity_group.py): newEntity.to_polylineslets multi-contour entities contribute one polyline per contour, so the array dialog's live preview draws all glyph outlines instead of only the first contour.tests/core/test_array_text_template.pycovers creation, rigidity of copies, content/font propagation, delete + regenerate, undo, duplication, and serialization round-trips.Dependency
Requires raygeo 1.52.0 (FontConfig copy protocol, barebaric/raygeo#29), which has been released and is pinned here in
requirements.txt,pixi.toml,pixi.lockand the debian bundle requirements. Older raygeo builds raiseTypeError: cannot pickle 'FontConfig'when a text box is deep-copied.