forked from 1b-agent/opencadstudio-upstream
refactor: remove remaining world_offset vestiges in app/
Clean up the last zero-valued world_offset locals outside the scene tessellation core: the UCS wire-affine / grid-basis origin shift (document.rs), the coordinate readout (view.rs), grip absolute-apply (update.rs), the dead properties-edit re-offset guard, the MTEXT preview glyph-box shift (mtext_editor.rs), and the cross-drawing paste correction (commands.rs / cmd_result.rs) — including the now-dead `clipboard_world_offset` field. Coordinates are absolute throughout. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
ef8d5b2610
commit
cc43969ce0
8 files changed
+12
-82
No files matched your search
+2
-11
@@ -395,7 +395,6 @@ impl super::OpenCADStudio {
|
||||
let Some(ed) = self.mtext_editor.as_ref() else { return };
|
||||
let mt = ed.build_mtext();
|
||||
let entity = EntityType::MText(mt.clone());
|
||||
let woff = [0.0_f64; 3];
|
||||
let anno = self.tabs[i].scene.annotation_scale;
|
||||
let wires: Vec<WireModel> = tessellate::tessellate(
|
||||
&self.tabs[i].scene.document,
|
||||
@@ -409,16 +408,8 @@ impl super::OpenCADStudio {
|
||||
anno,
|
||||
None,
|
||||
);
|
||||
// Per-character boxes in the same offset-subtracted frame as the
|
||||
// preview wires (tessellate removes world_offset; mirror that).
|
||||
let mut boxes = crate::entities::mtext::glyph_boxes(&mt, &self.tabs[i].scene.document);
|
||||
let (ox, oy) = (woff[0] as f32, woff[1] as f32);
|
||||
for b in &mut boxes {
|
||||
b.xmin -= ox;
|
||||
b.xmax -= ox;
|
||||
b.ymin -= oy;
|
||||
b.ymax -= oy;
|
||||
}
|
||||
// Per-character boxes share the preview wires' absolute coordinate frame.
|
||||
let boxes = crate::entities::mtext::glyph_boxes(&mt, &self.tabs[i].scene.document);
|
||||
if let Some(ed) = self.mtext_editor.as_mut() {
|
||||
ed.preview_wires = wires;
|
||||
ed.glyph_boxes = boxes;
|
||||
|
||||
Reference in new issue
Block a user