Skip to content

Commit

Permalink
fix eraser not updating on motion
Browse files Browse the repository at this point in the history
  • Loading branch information
flxzt committed Nov 1, 2021
1 parent 1125c97 commit 6673381
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/sheet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<p2d::bounding_volume::AABB>,
) -> bool {
) {
let priv_ = imp::Sheet::from_instance(self);

if let Some(ref eraser_current_input) = eraser.current_input {
Expand Down Expand Up @@ -682,9 +682,6 @@ impl Sheet {
.borrow_mut()
.append(&mut removed_strokes);

self.resize_autoexpand()
} else {
false
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/ui/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 6673381

Please sign in to comment.