forked from 1b-agent/opencadstudio-upstream
Merge pull request #1747 from schoeller/reference_only_entities
Reference-only entities (plugin API v9): a scene-scoped, in-memory designation for plugin-owned display geometry, plus HostNotification dispatch to native plugins so they can re-mark on DocumentOpened. Resolves the new DeltaSnapshot site in block_editor.rs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
68330ce39e
40 files changed
+1977
-85
No files matched your search
+12
-5
@@ -2665,10 +2665,14 @@ handles={handles_ms:.1} panel={:.1} ribbon={ribbon_ms:.1} tail={:.1} selected={}
|
||||
/// reachable from Options and from the sysvar of the same name.
|
||||
pub(super) fn refresh_selected_grips(&mut self) {
|
||||
let i = self.active_tab;
|
||||
// Reference-only targets are cancelled like locked-layer ones: the
|
||||
// plugin that owns the display geometry may have just designated the
|
||||
// entity, and a drag that edits it would be overwritten on refresh.
|
||||
let locked_active_grip = self.tabs[i].active_grip.as_ref().is_some_and(|grip| {
|
||||
grip.targets
|
||||
.iter()
|
||||
.any(|target| self.tabs[i].scene.is_layer_locked(target.handle))
|
||||
grip.targets.iter().any(|target| {
|
||||
self.tabs[i].scene.is_layer_locked(target.handle)
|
||||
|| self.tabs[i].scene.is_reference_only(target.handle)
|
||||
})
|
||||
});
|
||||
if locked_active_grip {
|
||||
self.cancel_active_grip_edit();
|
||||
@@ -2682,7 +2686,8 @@ handles={handles_ms:.1} panel={:.1} ribbon={ribbon_ms:.1} tail={:.1} selected={}
|
||||
let annotation_scale_handle = self.tabs[i].scene.displayed_annotation_scale_handle();
|
||||
let selected = self.tabs[i].scene.selected_entities();
|
||||
let single_handle = (selected.len() == 1
|
||||
&& !self.tabs[i].scene.is_layer_locked(selected[0].0))
|
||||
&& !self.tabs[i].scene.is_layer_locked(selected[0].0)
|
||||
&& !self.tabs[i].scene.is_reference_only(selected[0].0))
|
||||
.then(|| selected[0].0);
|
||||
let mut grips = Vec::new();
|
||||
let mut handles = Vec::new();
|
||||
@@ -2695,7 +2700,9 @@ handles={handles_ms:.1} panel={:.1} ribbon={ribbon_ms:.1} tail={:.1} selected={}
|
||||
selected
|
||||
};
|
||||
for (handle, entity) in selected {
|
||||
if self.tabs[i].scene.is_layer_locked(handle) {
|
||||
if self.tabs[i].scene.is_layer_locked(handle)
|
||||
|| self.tabs[i].scene.is_reference_only(handle)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
let contextual = crate::scene::annotative::entity_for_annotation_context(
|
||||
|
||||
Reference in new issue
Block a user