From 5c239f9a420ea86fae08be70deece25e0e1b98ff Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 20 Apr 2021 20:39:36 +0530 Subject: readd cursor; compress images with RLE --- src/app.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/app.rs b/src/app.rs index a987e0b..d0089e9 100644 --- a/src/app.rs +++ b/src/app.rs @@ -26,7 +26,7 @@ use std::{ path::{Path, PathBuf}, }; -use obi::Image; +use obi::{CompressionType, Image}; use sdl2::{ event::Event, keyboard::{Keycode, Mod}, @@ -428,11 +428,9 @@ impl<'ctx> AppState<'ctx> { fn draw_brush(&mut self) { let cs = self.zoom as u32; let pt = self.idx_at_coord(self.mouse); - self.context.mouse().show_cursor(true); if matches!(self.brush, Brush::Circle { .. } | Brush::Line { .. }) { let size = self.brush.size().unwrap(); if let Some(center) = pt { - self.context.mouse().show_cursor(false); let circle = self.pixmap.get_circle(center, size as u32, false); for MapPoint { x, y } in circle.into_iter() { self.canvas.set_draw_color(PINK); @@ -657,6 +655,7 @@ impl<'ctx> AppState<'ctx> { pub fn export(&self) -> Image { let mut image = Image::new(self.width(), self.height()); + image.use_compression(CompressionType::RLE); image.data = self.pixmap.data.clone(); image } -- cgit v1.2.3