rivertile: fix underflow if views < masters

This commit is contained in:
Isaac Freund 2020-06-19 13:53:20 +02:00
parent 582164ce41
commit 6e23344e06
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -66,7 +66,7 @@ pub fn main() !void {
const output_width = try std.fmt.parseInt(u32, std.mem.spanZ(args[width_arg]), 10);
const output_height = try std.fmt.parseInt(u32, std.mem.spanZ(args[height_arg]), 10);
const secondary_count = num_views - master_count;
const secondary_count = if (num_views > master_count) num_views - master_count else 0;
// to make things pixel-perfect, we make the first master and first secondary
// view slightly larger if the height is not evenly divisible