Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/bitmap/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use super::rgba::Rgba;
///
/// In memory representation of a bitmap allowing for easier editing
///
#[derive(Debug)]
pub struct BitMap {
/// file read from
filename: Option<String>,
Expand Down Expand Up @@ -313,7 +314,7 @@ impl BitMap {
for y in from_y..to_y {
for x in from_x..to_x {
let index = self.get_index(x, y);
let colors_index = (((height - y - from_y - 1) * width) + x - from_x) as usize;
let colors_index = ((y - from_y) * width + x - from_x) as usize;
colors[colors_index] = self.pixels[index];
}
}
Expand Down