From f4cd5d7edc458535c8ab5245c5829a23fca4e5ef Mon Sep 17 00:00:00 2001 From: gennyble Date: Sat, 7 Dec 2024 03:09:34 -0600 Subject: Save etches as GIF --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.rs') 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(); + } } } -- cgit 1.4.1-3-g733a5