fix: don't add model-space world_offset to paper-space grip absolute positions

GripApply::Absolute adds world_offset to convert local-space coordinates
back to DXF space for model-space entities. Paper-space entities (viewports,
etc.) use sheet mm coordinates with no world_offset, but the grip drag code
was unconditionally adding scene.world_offset — causing grips to jump by the
full model-space centroid offset (potentially hundreds of km for UTM drawings).

Now world_offset is only applied when current_layout == "Model".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Sonnet 4.6 committed 2026-05-01 21:19:09 +03:00
1 parent 93614ab554
commit 928e7df274
1 file changed
+8 -2
+8 -2
View File
@@ -1228,8 +1228,14 @@ impl H7CAD {
}
}
let wo = self.tabs[i].scene.world_offset;
let wo_vec = glam::Vec3::new(wo[0] as f32, wo[1] as f32, wo[2] as f32);
// Paper-space entities use sheet coordinates (no world_offset).
// Only add world_offset when converting local → DXF space in model space.
let wo_vec = if self.tabs[i].scene.current_layout == "Model" {
let wo = self.tabs[i].scene.world_offset;
glam::Vec3::new(wo[0] as f32, wo[1] as f32, wo[2] as f32)
} else {
glam::Vec3::ZERO
};
let apply = if grip.is_translate {
GripApply::Translate(snapped - grip.last_world)
} else {