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