Skip to content

Commit

Permalink
Fix off by one error in line drawing routine
Browse files Browse the repository at this point in the history
  • Loading branch information
caspark committed Feb 6, 2024
1 parent 8cb8035 commit f9b2456
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/canvas_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl Canvas {
let derror2 = dy.abs() * 2;
let mut error2 = 0;
let mut y = y0;
for x in x0..x1 {
for x in x0..=x1 {
if steep {
*self.pixel_mut(y as i32, x as i32) = color;
} else {
Expand Down

0 comments on commit f9b2456

Please sign in to comment.