Fix bug where non-square images would not be completely rendered

This commit is contained in:
Matthew Gordon 2019-11-26 06:59:26 -05:00
parent 86ef364ed2
commit d9912c42dd
1 changed files with 2 additions and 2 deletions

View File

@ -99,11 +99,11 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
for tile_row in 0..(output_image.get_height() + 1) / tile_size { for tile_row in 0..(output_image.get_height() + 1) / tile_size {
for tile_column in 0..(output_image.get_width() + 1) / tile_size { for tile_column in 0..(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_width()); 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;
let column_end = min( let column_end = min(
tile_column * tile_size + tile_size, tile_column * tile_size + tile_size,
output_image.get_height(), output_image.get_width(),
); );
partial_render_scene( partial_render_scene(
&mut output_image, &mut output_image,