diff options
Diffstat (limited to 'src/render.rs')
-rw-r--r-- | src/render.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/render.rs b/src/render.rs index 53edd2c..1b15c1c 100644 --- a/src/render.rs +++ b/src/render.rs @@ -4,10 +4,9 @@ use image::{ imageops, CatmullRom, DynamicImage, GenericImage, GenericImageView, ImageBuffer, Pixel, Primitive, Rgba, RgbaImage, }; -use imageproc::drawing; +use imageproc::{drawing, rect::Rect}; use num_traits::NumCast; use rusttype::{Font, Scale, SharedBytes}; -use std::cmp::min; quick_error! { #[derive(Debug)] @@ -398,12 +397,8 @@ fn draw_thick_line<I>( let mut line_buffer: RgbaImage = ImageBuffer::new(line_length, line_length); let halfway = (line_length - thickness) / 2; - for i in 0..thickness { - for x in 0..line_length { - let y = halfway + i; - line_buffer.put_pixel(x, y, color); - } - } + let rect = Rect::at(0, halfway as i32).of_size(line_length, thickness); + drawing::draw_filled_rect_mut(&mut line_buffer, rect, color); line_buffer = imageproc::geometric_transformations::rotate_about_center( &line_buffer, |