Skip to content

Commit

Permalink
Fix crash when guideline selected and reloaded fontinfo removes it
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlcctrlv committed Dec 22, 2021
1 parent 71b10b7 commit 113cf28
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tools/guidelines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ impl Tool for Guidelines {
#[rustfmt::skip]
fn event(&mut self, v: &mut Editor, i: &mut Interface, event: EditorEvent) {
match event {
EditorEvent::IOEvent { event_type: IOEventType::FontinfoReloaded, .. } => {
self.selected_idx = None;
}
EditorEvent::MouseEvent { mouse_info, event_type } => match event_type {
MouseEventType::Pressed => self.mouse_pressed(v, i, mouse_info),
_ => (),
Expand Down

0 comments on commit 113cf28

Please sign in to comment.