Fix crashing bug for window size smaller than 2 * (border width + gap size)

This commit is contained in:
Leon Henrik Plickat 2020-08-10 16:04:21 +02:00 committed by Isaac Freund
parent e66c8b0019
commit 45a730cbd3

View file

@ -269,8 +269,10 @@ fn layoutExternal(self: *Self, visible_count: u32) !void {
var box = try parseBox(token);
box.x += self.usable_box.x + xy_offset;
box.y += self.usable_box.y + xy_offset;
box.width -= delta_size;
box.height -= delta_size;
if (box.width > delta_size) box.width -= delta_size;
if (box.height > delta_size) box.height -= delta_size;
try view_boxen.append(box);
}