window: use saturating sub in border calcs
This commit is contained in:
parent
40e5b673b6
commit
7c03077177
1 changed files with 2 additions and 2 deletions
|
@ -182,8 +182,8 @@ pub fn child(self: Window, opts: ChildOptions) Window {
|
||||||
const y_off: usize = if (loc.top) 1 else 0;
|
const y_off: usize = if (loc.top) 1 else 0;
|
||||||
const h_delt: usize = if (loc.bottom) 1 else 0;
|
const h_delt: usize = if (loc.bottom) 1 else 0;
|
||||||
const w_delt: usize = if (loc.right) 1 else 0;
|
const w_delt: usize = if (loc.right) 1 else 0;
|
||||||
const h_ch: usize = h - y_off - h_delt;
|
const h_ch: usize = h -| y_off -| h_delt;
|
||||||
const w_ch: usize = w - x_off - w_delt;
|
const w_ch: usize = w -| x_off -| w_delt;
|
||||||
return result.initChild(x_off, y_off, .{ .limit = w_ch }, .{ .limit = h_ch });
|
return result.initChild(x_off, y_off, .{ .limit = w_ch }, .{ .limit = h_ch });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue