Fix crop region checks on non-square maps

This commit is contained in:
Tad Hardesty 2018-01-19 14:27:15 -08:00
parent 8917b39a2b
commit 1a652f39a2

View file

@ -38,7 +38,7 @@ pub fn generate(
// transform min/max from bottom-left-based to top-left-based
// probably doesn't belong here
let (_, len_y) = ctx.grid.dim();
let (len_y, _) = ctx.grid.dim();
let (min_y, max_y) = (len_y - ctx.max.1 - 1, len_y - ctx.min.1 - 1);
let (len_x, len_y) = (ctx.max.0 - ctx.min.0 + 1, ctx.max.1 - ctx.min.1 + 1);