Bind Scenario selection capture directly for strict lint
This commit is contained in:
@@ -2202,7 +2202,7 @@ impl canvas::Program<Message> for Scene {
|
|||||||
if !editable {
|
if !editable {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
if self.selection.is_some() {
|
if let Some((selection_context, snapshot)) = &self.selection {
|
||||||
let hit = self.hit_item(point).or_else(|| {
|
let hit = self.hit_item(point).or_else(|| {
|
||||||
(!self.is_group()
|
(!self.is_group()
|
||||||
&& self.is_selected(self.selected)
|
&& self.is_selected(self.selected)
|
||||||
@@ -2234,10 +2234,8 @@ impl canvas::Program<Message> for Scene {
|
|||||||
.selection_action(Intent::Choose(target, Choice::Toggle));
|
.selection_action(Intent::Choose(target, Choice::Toggle));
|
||||||
}
|
}
|
||||||
if self.is_group() && self.is_selected(hit.id) {
|
if self.is_group() && self.is_selected(hit.id) {
|
||||||
let (context, snapshot) =
|
|
||||||
self.selection.as_ref().expect("selection capture");
|
|
||||||
state.group_press = Some(ScenarioGroupPress {
|
state.group_press = Some(ScenarioGroupPress {
|
||||||
context: *context,
|
context: *selection_context,
|
||||||
snapshot: snapshot.clone(),
|
snapshot: snapshot.clone(),
|
||||||
target,
|
target,
|
||||||
start: cursor.position()?,
|
start: cursor.position()?,
|
||||||
@@ -2259,10 +2257,9 @@ impl canvas::Program<Message> for Scene {
|
|||||||
if state.modifiers.shift() {
|
if state.modifiers.shift() {
|
||||||
return Some(Action::capture());
|
return Some(Action::capture());
|
||||||
}
|
}
|
||||||
let (context, snapshot) = self.selection.as_ref()?;
|
|
||||||
// Background clearing shares this press with camera panning.
|
// Background clearing shares this press with camera panning.
|
||||||
return Some(Action::publish(scenario::selection::message(
|
return Some(Action::publish(scenario::selection::message(
|
||||||
*context,
|
*selection_context,
|
||||||
snapshot,
|
snapshot,
|
||||||
Intent::Clear,
|
Intent::Clear,
|
||||||
)));
|
)));
|
||||||
|
|||||||
Reference in New Issue
Block a user