URI: 
       Fixed draw filled operations. - icy_draw - icy_draw is the successor to mystic draw. fork / mirror
  HTML git clone https://git.drkhsh.at/icy_draw.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 7bbfc290d52d95462efc8e8d73b2da6e6f9cfe12
   DIR parent 1b1fa6195551283243c467a39866b8cf1377c9a4
  HTML Author: Mike Krüger <mkrueger@posteo.de>
       Date:   Mon, 28 Aug 2023 21:29:40 +0200
       
       Fixed draw filled operations.
       
       Diffstat:
         M src/model/tools/draw_rectangle_fil… |       2 ++
         M src/model/tools/line_imp.rs         |       4 ++--
         M src/model/tools/mod.rs              |       7 +++++--
       
       3 files changed, 9 insertions(+), 4 deletions(-)
       ---
   DIR diff --git a/src/model/tools/draw_rectangle_filled_imp.rs b/src/model/tools/draw_rectangle_filled_imp.rs
       @@ -106,6 +106,8 @@ impl Tool for DrawRectangleFilledTool {
                lines.add_rectangle(Rectangle::from_pt(start, cur));
        
                let draw = move |rect: Rectangle| {
       +
       +            println!("draw rect: {:?}", rect  );
                    for y in 0..rect.size.height {
                        for x in 0..rect.size.width {
                            plot_point(
   DIR diff --git a/src/model/tools/line_imp.rs b/src/model/tools/line_imp.rs
       @@ -392,7 +392,7 @@ fn get_half_block(
            )
        }
        
       -pub fn set_half_block(editor: &mut AnsiEditor, pos: Position, col: u32) {
       +pub fn set_half_block(editor: &AnsiEditor, pos: Position, col: u32) {
            let w = editor.buffer_view.lock().buf.get_buffer_width();
            let h = editor.buffer_view.lock().buf.get_real_buffer_height();
        
       @@ -452,7 +452,7 @@ pub fn set_half_block(editor: &mut AnsiEditor, pos: Position, col: u32) {
            optimize_block(editor, Position::new(pos.x, text_y));
        }
        
       -fn optimize_block(editor: &mut AnsiEditor, pos: Position) {
       +fn optimize_block(editor: &AnsiEditor, pos: Position) {
            let block = if let Some(layer) = editor.buffer_view.lock().buf.get_overlay_layer() {
                layer.get_char(pos)
            } else {
   DIR diff --git a/src/model/tools/mod.rs b/src/model/tools/mod.rs
       @@ -17,7 +17,7 @@ mod icons;
        
        use eframe::egui;
        use egui_extras::RetainedImage;
       -use icy_engine::{AttributedChar, Position};
       +use icy_engine::{AttributedChar, Position, TextAttribute};
        pub use scan_lines::*;
        
        use crate::{AnsiEditor, Event};
       @@ -412,10 +412,13 @@ trait Plottable {
            fn get_char_code(&self) -> char;
        }
        
       -fn plot_point(editor: &mut AnsiEditor, tool: &dyn Plottable, pos: Position) {
       +fn plot_point(editor: &AnsiEditor, tool: &dyn Plottable, pos: Position) {
            let ch = editor.get_char_from_cur_layer(pos);
            let editor_attr = editor.buffer_view.lock().caret.get_attribute();
            let mut attribute = ch.attribute;
       +    if !ch.is_visible() {
       +        attribute = TextAttribute::default();
       +    }
            if tool.get_use_back() {
                attribute.set_background(editor_attr.get_background());
            }