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

+5
View File
@@ -752,6 +752,10 @@ pub struct Scene {
pub selection_filter: HashSet<String>,
/// In-progress preview wires while a command is active (rubber-band + object ghosts).
pub preview_wires: Vec<WireModel>,
/// In-progress preview SDF glyph quads (grip drag / command preview). Rides
/// a per-frame GPU buffer separate from the epoch-cached base text so the
/// dragged text stays visible while it's hidden from the base set (#316).
pub preview_text: Vec<crate::scene::pipeline::text_gpu::TextVertex>,
/// Committed-segment wire drawn during multi-point commands (normal colour).
pub interim_wire: Option<WireModel>,
pub camera_generation: u64,
@@ -995,6 +999,7 @@ impl Scene {
transparency_display: true,
selection_filter: HashSet::default(),
preview_wires: vec![],
preview_text: vec![],
interim_wire: None,
camera_generation: 0,
geometry_epoch: GEOMETRY_EPOCH.fetch_add(1, Ordering::Relaxed),