Skip to content

Commit 4357b0c

Browse files
authored
Merge pull request #123 from elwerene/fix-bitmap-plotting
correctly plit bitmap
2 parents 5cf3bfd + 8ed8649 commit 4357b0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/drawing/backend.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ pub trait DrawingBackend: Sized {
267267
break;
268268
}
269269
// FIXME: This assume we have RGB image buffer
270-
let r = src[(dx + dy * w) as usize * 3];
271-
let g = src[(dx + dy * w) as usize * 3 + 1];
272-
let b = src[(dx + dy * w) as usize * 3 + 2];
270+
let r = src[(dx + dy * iw) as usize * 3];
271+
let g = src[(dx + dy * iw) as usize * 3 + 1];
272+
let b = src[(dx + dy * iw) as usize * 3 + 2];
273273
let color = crate::style::RGBColor(r, g, b);
274274
let result =
275275
self.draw_pixel((pos.0 + dx as i32, pos.1 + dy as i32), &color.to_rgba());

0 commit comments

Comments
 (0)