From 667338174cec33f438ef57c783bb2149db505810 Mon Sep 17 00:00:00 2001 From: Felix Zwettler Date: Mon, 1 Nov 2021 02:11:26 +0100 Subject: [PATCH] fix eraser not updating on motion --- src/sheet/mod.rs | 7 ++----- src/ui/canvas.rs | 7 +++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sheet/mod.rs b/src/sheet/mod.rs index 10de9a8696..d840fb8e51 100644 --- a/src/sheet/mod.rs +++ b/src/sheet/mod.rs @@ -604,12 +604,12 @@ impl Sheet { } } - /// returns true if resizing is needed + /// remove any colliding stroke pub fn remove_colliding_strokes( &self, eraser: &Eraser, viewport: Option, - ) -> bool { + ) { let priv_ = imp::Sheet::from_instance(self); if let Some(ref eraser_current_input) = eraser.current_input { @@ -682,9 +682,6 @@ impl Sheet { .borrow_mut() .append(&mut removed_strokes); - self.resize_autoexpand() - } else { - false } } diff --git a/src/ui/canvas.rs b/src/ui/canvas.rs index ca1dce70df..4919cfdb8a 100644 --- a/src/ui/canvas.rs +++ b/src/ui/canvas.rs @@ -1066,12 +1066,15 @@ impl Canvas { if let Some(inputdata) = data_entries.pop_back() { self.pens().borrow_mut().eraser.current_input = Some(inputdata); - if self.sheet().remove_colliding_strokes( + + self.sheet().remove_colliding_strokes( &self.pens().borrow().eraser, canvas_scroller_viewport_descaled, - ) { + ); + if self.sheet().resize_autoexpand() { self.regenerate_background(false, true); } + self.queue_draw(); } } PenStyle::Selector => {