1const Window = @import("../Window.zig"); 2 3pub fn center(parent: Window, cols: usize, rows: usize) Window { 4 const y_off = (parent.height / 2) -| (rows / 2); 5 const x_off = (parent.width / 2) -| (cols / 2); 6 return parent.initChild(x_off, y_off, .{ .limit = cols }, .{ .limit = rows }); 7}