Preserve read-only panning while canceling State edits

This commit is contained in:
2026-09-22 21:21:50 -07:00
parent 26979c1093
commit b8685416f5
3 changed files with 25 additions and 2 deletions
@@ -136,13 +136,16 @@ enum Hit {
}
impl State {
fn cancel_gesture(&mut self) {
fn cancel_edit(&mut self) {
self.press = None;
self.preview = None;
self.attachment_preview = None;
self.bend = None;
self.bend_preview = None;
self.attachment_viewport = None;
}
fn cancel_gesture(&mut self) {
self.cancel_edit();
self.pan_from = None;
}
fn reset(&mut self) {
@@ -1178,7 +1181,9 @@ impl canvas::Program<Event> for StateCanvas<'_> {
state.tool = Some(self.tool);
}
if !self.editable {
state.cancel_gesture();
// Pending edits block model changes, but read-only panning remains
// available and must survive successive pointer events.
state.cancel_edit();
state.source = None;
}
if state