diff options
author | gennyble <gen@nyble.dev> | 2024-12-07 03:09:34 -0600 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2024-12-07 03:09:34 -0600 |
commit | f4cd5d7edc458535c8ab5245c5829a23fca4e5ef (patch) | |
tree | 5b29e12c6fcdc4591d0b257c8a9fbc58c4a7cf48 /src/main.rs | |
parent | e29e66de1bbee0569a0707dd9bd603f221e6e970 (diff) | |
download | really-etches-f4cd5d7edc458535c8ab5245c5829a23fca4e5ef.tar.gz really-etches-f4cd5d7edc458535c8ab5245c5829a23fca4e5ef.zip |
Save etches as GIF
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index b1f22ab..30c374b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ use tracing_subscriber::EnvFilter; use winit::{ application::ApplicationHandler, dpi::LogicalSize, - event::{DeviceEvent, KeyEvent, WindowEvent}, + event::{KeyEvent, WindowEvent}, event_loop::{ControlFlow, EventLoop}, keyboard::{Key, NamedKey}, window::Window, @@ -125,7 +125,11 @@ impl Etch { .set_file_name("etch.gif") .save_file(); - if let Some(path) = location {} + if let Some(path) = location { + tracing::info!("saving gif to {}", path.to_string_lossy()); + let gif = self.img.gif(); + gif.save(path).unwrap(); + } } } |