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 --- Cargo.lock | 1 - Cargo.toml | 3 ++- src/app.rs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0390f04..2ac9444 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,7 +122,6 @@ checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "obi" version = "0.1.0" -source = "git+https://github.com/nerdypepper/obi?rev=7d2924015e691fa229c6b6fd96240ef47b3a9e5f#7d2924015e691fa229c6b6fd96240ef47b3a9e5f" dependencies = [ "bitvec", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index c76160a..311e10b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,8 @@ edition = "2018" [dependencies] sdl2 = {version = "0.34", features = ["ttf"]} -obi = { git = "https://github.com/nerdypepper/obi", rev = "7d2924015e691fa229c6b6fd96240ef47b3a9e5f" } +# obi = { git = "https://github.com/nerdypepper/obi", rev = "63af58d6a3fd68bdb313305881627dab534346e2" } +obi = { path = "../obi"} env_logger = "0.8.3" log = "0.4.0" pico-args = "0.4.0" 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