Skip to content

Commit

Permalink
fix zero sized mosaic tiles crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Kl4rry committed Oct 22, 2024
1 parent b4a7213 commit 18041da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/image_view/mosaic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ impl Mosaic {
let end_x = ((x + 1) * limit).min(image.width());
let end_y = ((y + 1) * limit).min(image.height());

if end_x.saturating_sub(start_x) == 0 || end_x.saturating_sub(start_x) == 0 {
eprintln!("start_x: {}", start_x);
eprintln!("start_y: {}", start_y);
eprintln!("end_x: {}", end_x);
eprintln!("end_y: {}", end_y);

if end_x.saturating_sub(start_x) == 0 || end_y.saturating_sub(start_y) == 0 {
continue;
}

Expand Down

0 comments on commit 18041da

Please sign in to comment.