aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-03-24 12:54:39 +0000
committerAkshay <[email protected]>2021-03-24 12:54:39 +0000
commit96120e602f43e225d22af6ec1053ebc6797a79f7 (patch)
tree8f27c503efeebefa225191ef73ffe516abcd554b /src/app.rs
parent240aca36313016df68f03954c54c2bc21910344e (diff)
new quit primitive
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/app.rs b/src/app.rs
index 008b273..d35febf 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -470,6 +470,11 @@ impl<'ctx> AppState<'ctx> {
470 self.draw(); 470 self.draw();
471 self.canvas.present(); 471 self.canvas.present();
472 } 472 }
473
474 pub fn quit(&mut self) {
475 let ev = self.context.event().unwrap();
476 ev.push_event(Event::Quit { timestamp: 0u32 });
477 }
473} 478}
474 479
475// publicly available functions on appstate 480// publicly available functions on appstate
@@ -606,8 +611,6 @@ impl<'ctx> AppState<'ctx> {
606 } 611 }
607 } 612 }
608 Keycode::V => self.cycle_symmetry(), 613 Keycode::V => self.cycle_symmetry(),
609 // exit
610 Keycode::Escape => break 'running,
611 // undo & redo 614 // undo & redo
612 Keycode::U => { 615 Keycode::U => {
613 if let Some(op) = self.undo_stack.undo() { 616 if let Some(op) = self.undo_stack.undo() {