fix(text): grip-drag no longer hides text (#316)

Dragging text by a grip hid it until release. The dragged entity is
hidden from the base wire set and shown as a preview overlay, but its
SDF glyph quads (text_verts) were never uploaded for the preview, so
the text vanished mid-drag.

Add a per-frame preview_text GPU buffer (sibling to preview_wires). A
rigid whole-entity move of pure text (TEXT/MTEXT, Square insertion grip)
slides the drag-start glyphs by the drag delta instead of re-shaping the
run every move; reshape grips (MTEXT width), dimensions and wire
entities re-tessellate and feed the same buffer.

Also fold preview_text into render_signature: a pure-text slide leaves
preview_wires empty, so without it the scene-render cache froze the
dragged text at its first frame (grip moved but text stayed, then
jumped to place on release).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-10 10:39:44 +03:00
1 parent 88450f0cd1
commit 67fe363775
9 files changed
+176 -5

No files matched your search

+11
View File
@@ -377,6 +377,15 @@ pub(super) struct OpenCADStudio {
/// the document live (so grips / properties track), so cancel reverts from
/// this backup. Dropped (kept) on a normal commit.
grip_original: Option<acadrust::EntityType>,
/// Drag-start snapshot of the dragged entity's SDF glyph quads. A whole-
/// entity text move slides these each frame (translating the already-shaped
/// glyphs) instead of re-tessellating the run every cursor move (issue #316).
grip_text_verts: Vec<crate::scene::pipeline::text_gpu::TextVertex>,
/// True when the current grip drag is a rigid whole-entity move of pure text
/// (TEXT / MTEXT, no wire geometry, insertion grip) — the case where the
/// glyphs can just be slid. A reshape grip (e.g. an MTEXT width handle) or an
/// entity with wires re-tessellates instead so the preview stays exact.
grip_text_slide: bool,
/// Open Quick Select panel state. `None` = panel closed. Filters are
/// applied via `Message::QSelectApply`; the panel is dismissed on
/// Apply / Cancel / Esc / outside-click.
@@ -2101,6 +2110,8 @@ impl OpenCADStudio {
grip_preview_handle: None,
hover_dwell: None,
grip_original: None,
grip_text_verts: Vec::new(),
grip_text_slide: false,
qselect: None,
show_ucs_icon: true,
ucs_icon_at_origin: true,