From 748d082ef3b54585c2a1c08d0a07d064b73fb23f Mon Sep 17 00:00:00 2001 From: Orycterope Date: Thu, 14 Mar 2019 16:15:33 +0000 Subject: [PATCH] shell: gif window size When displaying a GIF, create a window the size of the gif. Fixes #217 --- shell/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/src/main.rs b/shell/src/main.rs index 45653d3bc..11eb2fdcc 100644 --- a/shell/src/main.rs +++ b/shell/src/main.rs @@ -79,8 +79,8 @@ fn main() { /// Shows a GIF in a new window, blocking the caller. When a key is pressed, the /// window is closed and control is given back to the caller. fn show_gif(louis: &[u8]) { - let mut window = Window::new(0, 0, 1280, 800).unwrap(); let mut reader = gif::Decoder::new(&louis[..]).read_info().unwrap(); + let mut window = Window::new(0, 0, u32::from(reader.width()), u32::from(reader.height())).unwrap(); let mut buf = Vec::new(); loop {