forked from 1b-agent/opencadstudio-upstream
fix(precision): keep BLOCK base and TEXT/MTEXT insertion points in f64 (#311)
Three commit helpers narrowed a typed/picked point back to f32 before it reached the persisted entity, so the coordinate was quantized to the f32 grid (worse at large/UTM extents): - Scene::create_block_from_entities took the base point as glam::Vec3, so the block's local-space translation and the replacement INSERT's insert point were f32. Param is now DVec3 (matching the sibling define_block_from_owned_entities); the command_driver handler no longer downcasts with as_vec3(). - The MTEXT and TEXT in-place editors stored `pos` as Vec3 and built the committed insertion_point from it, quantizing a new label's position and re-quantizing an existing one on edit. Both `pos` fields are now DVec3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f89b78a7e
commit
553b91015f
5 files changed
+20
-20
No files matched your search
@@ -378,7 +378,7 @@ impl OpenCADStudio {
|
||||
self.push_undo_snapshot(i, "BLOCK");
|
||||
match self.tabs[i]
|
||||
.scene
|
||||
.create_block_from_entities(&handles, &name, base.as_vec3())
|
||||
.create_block_from_entities(&handles, &name, base)
|
||||
{
|
||||
Ok(insert_handle) => {
|
||||
self.tabs[i].dirty = true;
|
||||
@@ -1858,7 +1858,7 @@ impl OpenCADStudio {
|
||||
} => {
|
||||
self.tabs[i].active_cmd = None;
|
||||
self.tabs[i].snap_result = None;
|
||||
self.open_mtext_editor(pos.as_vec3(), handle, &initial, height);
|
||||
self.open_mtext_editor(pos, handle, &initial, height);
|
||||
}
|
||||
CmdResult::OpenTextEditor {
|
||||
pos,
|
||||
@@ -1869,7 +1869,7 @@ impl OpenCADStudio {
|
||||
self.tabs[i].active_cmd = None;
|
||||
self.tabs[i].snap_result = None;
|
||||
self.open_text_inline(
|
||||
pos.as_vec3(),
|
||||
pos,
|
||||
handle,
|
||||
&initial,
|
||||
height,
|
||||
|
||||
Reference in new issue
Block a user