fix(layers): protect locked entities

Keep locked-layer objects selectable for inspection while suppressing grips, property edits, command mutations, and stale editor writes.
This commit is contained in:
Hakan Seven committed 2026-08-12 12:46:41 +03:00
1 parent ca331fff48
commit 0be9c41773
25 files changed
+524 -118

No files matched your search

+10
View File
@@ -606,6 +606,9 @@ impl super::OpenCADStudio {
initial: &str,
height: f64,
) {
if handle.is_some_and(|h| self.tabs[self.active_tab].scene.is_layer_locked(h)) {
return;
}
let mut state = MTextEditorState::new(pos, initial, height, handle);
if let Some(p) = self.tabs[self.active_tab].scene.selection.borrow().last_move_pos {
state.screen_anchor = p;
@@ -1222,6 +1225,10 @@ impl super::OpenCADStudio {
return false;
}
if let Some(h) = ed.editing {
if self.tabs[i].scene.is_layer_locked(h) {
self.refresh_properties();
return false;
}
self.push_undo_snapshot(i, "MTEXT");
match self.tabs[i].scene.document.get_entity_mut(h) {
Some(EntityType::MText(t)) => {
@@ -1307,6 +1314,9 @@ impl super::OpenCADStudio {
return;
}
if let Some(h) = editing {
if self.tabs[i].scene.is_layer_locked(h) {
return;
}
self.push_undo_snapshot(i, "MTEXT");
match self.tabs[i].scene.document.get_entity_mut(h) {
Some(EntityType::MText(t)) => {