aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-04-20 16:09:36 +0100
committerAkshay <[email protected]>2021-04-20 16:09:36 +0100
commit5c239f9a420ea86fae08be70deece25e0e1b98ff (patch)
treeb969ecf0745147fb1f178f90ce3da567b5355bd0 /src
parent699375e14c63ca6f52b79b56de1d572c3497587a (diff)
readd cursor; compress images with RLE
Diffstat (limited to 'src')
-rw-r--r--src/app.rs5
1 files changed, 2 insertions, 3 deletions
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::{
26 path::{Path, PathBuf}, 26 path::{Path, PathBuf},
27}; 27};
28 28
29use obi::Image; 29use obi::{CompressionType, Image};
30use sdl2::{ 30use sdl2::{
31 event::Event, 31 event::Event,
32 keyboard::{Keycode, Mod}, 32 keyboard::{Keycode, Mod},
@@ -428,11 +428,9 @@ impl<'ctx> AppState<'ctx> {
428 fn draw_brush(&mut self) { 428 fn draw_brush(&mut self) {
429 let cs = self.zoom as u32; 429 let cs = self.zoom as u32;
430 let pt = self.idx_at_coord(self.mouse); 430 let pt = self.idx_at_coord(self.mouse);
431 self.context.mouse().show_cursor(true);
432 if matches!(self.brush, Brush::Circle { .. } | Brush::Line { .. }) { 431 if matches!(self.brush, Brush::Circle { .. } | Brush::Line { .. }) {
433 let size = self.brush.size().unwrap(); 432 let size = self.brush.size().unwrap();
434 if let Some(center) = pt { 433 if let Some(center) = pt {
435 self.context.mouse().show_cursor(false);
436 let circle = self.pixmap.get_circle(center, size as u32, false); 434 let circle = self.pixmap.get_circle(center, size as u32, false);
437 for MapPoint { x, y } in circle.into_iter() { 435 for MapPoint { x, y } in circle.into_iter() {
438 self.canvas.set_draw_color(PINK); 436 self.canvas.set_draw_color(PINK);
@@ -657,6 +655,7 @@ impl<'ctx> AppState<'ctx> {
657 655
658 pub fn export(&self) -> Image { 656 pub fn export(&self) -> Image {
659 let mut image = Image::new(self.width(), self.height()); 657 let mut image = Image::new(self.width(), self.height());
658 image.use_compression(CompressionType::RLE);
660 image.data = self.pixmap.data.clone(); 659 image.data = self.pixmap.data.clone();
661 image 660 image
662 } 661 }