Fix bug rendering images with dimensinos not multiples of tile size

This commit is contained in:
Matthew Gordon 2019-11-26 07:03:45 -05:00
parent d9912c42dd
commit 430053c134
1 changed files with 2 additions and 2 deletions

View File

@ -96,8 +96,8 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut i = 0; let mut i = 0;
'running: loop { 'running: loop {
let tile_size = 128; let tile_size = 128;
for tile_row in 0..(output_image.get_height() + 1) / tile_size { for tile_row in 0..1 + (output_image.get_height() + 1) / tile_size {
for tile_column in 0..(output_image.get_width() + 1) / tile_size { for tile_column in 0..1 + (output_image.get_width() + 1) / tile_size {
let row_start = tile_row * tile_size; let row_start = tile_row * tile_size;
let row_end = min(tile_row * tile_size + tile_size, output_image.get_height()); let row_end = min(tile_row * tile_size + tile_size, output_image.get_height());
let column_start = tile_column * tile_size; let column_start = tile_column * tile_size;