Resolve removal menu import and share visibility admission
This commit is contained in:
@@ -3,6 +3,7 @@ use super::*;
|
||||
use crate::behavior::scenario::{self, group_removal, selection};
|
||||
use crate::diagram_selection::Snapshot;
|
||||
use crate::diagram_usage::Target;
|
||||
use crate::model_menu;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -50,15 +51,19 @@ impl App {
|
||||
}
|
||||
|
||||
fn scenario_removal_matches(&self, context: scenario::Context, snapshot: &Snapshot) -> bool {
|
||||
self.scenario_context() == Some(context)
|
||||
&& self
|
||||
if self.scenario_context() != Some(context)
|
||||
|| !self
|
||||
.diagram_selection
|
||||
.as_ref()
|
||||
.is_some_and(|selected| selected.matches(snapshot, selection::context(context)))
|
||||
&& snapshot
|
||||
.targets()
|
||||
.iter()
|
||||
.all(|target| self.multiselect_target_visible(target))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
let visible = selection::visible(self.project(), context, self.selected);
|
||||
snapshot
|
||||
.targets()
|
||||
.iter()
|
||||
.all(|target| visible.contains(target))
|
||||
}
|
||||
|
||||
pub(super) fn scenario_removal_event(&mut self, event: Event) -> Task<Message> {
|
||||
|
||||
Reference in New Issue
Block a user