git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit7d95ae0ea06ae3fa60c44d2fb2797b2399cb6b68
parentd9a09e1721
authorIsaac Freund <[email protected]>
date2020-06-19 13:53
rivertile: fix underflow if views < masters

 rivertile/main.zig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rivertile/main.zig b/rivertile/main.zig
index 911754e..e669920 100644
--- a/rivertile/main.zig
+++ b/rivertile/main.zig
@@ -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