diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app.rs | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -26,7 +26,7 @@ use std::{ | |||
26 | path::{Path, PathBuf}, | 26 | path::{Path, PathBuf}, |
27 | }; | 27 | }; |
28 | 28 | ||
29 | use obi::Image; | 29 | use obi::{CompressionType, Image}; |
30 | use sdl2::{ | 30 | use 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 | } |