Fixed rectangle drawing. - 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 2c6e643df5a9e51082740f69e51c3cb2cd8faba2
DIR parent 96bcfc8adc2e885b45c3ea17526ac0ca4fd20080
HTML Author: Mike Krüger <mkrueger@posteo.de>
Date: Wed, 11 Oct 2023 10:52:43 +0200
Fixed rectangle drawing.
Diffstat:
M src/paint/rectangle.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/src/paint/rectangle.rs b/src/paint/rectangle.rs
@@ -13,12 +13,12 @@ pub fn draw_rectangle(buffer_view: &mut BufferView, from: impl Into<Position>, t
y_mul = 2;
}
- for x in from.x..to.x {
+ for x in from.x + 1..to.x {
plot_point(buffer_view, (x, from.y * y_mul), mode.clone(), color_mode, PointRole::TopSide);
plot_point(buffer_view, (x, to.y * y_mul), mode.clone(), color_mode, PointRole::BottomSide);
}
- for y in from.y..to.y {
+ for y in from.y + 1..to.y {
plot_point(buffer_view, (from.x, y * y_mul), mode.clone(), color_mode, PointRole::LeftSide);
plot_point(buffer_view, (to.x, y * y_mul), mode.clone(), color_mode, PointRole::RightSide);
}