fix underflows

This commit is contained in:
facile pop culture reference 2026-09-17 16:01:39 +03:00
parent 3a55f2fb18
commit 87d1c0a811

View file

@ -214,19 +214,19 @@ pub fn bar_areas <'a, S: Screen> (
Ok(match split {
Split::South => (
Some(XYWH(x0, y0, w0, n)),
Some(XYWH(x0, y0 + n, w0, h0 - n)),
Some(XYWH(x0, y0 + n, w0, h0.minus(n))),
),
Split::East => (
Some(XYWH(x0, y0, n, h0)),
Some(XYWH(x0 + n, y0, w0 - n, h0)),
Some(XYWH(x0 + n, y0, w0.minus(n), h0)),
),
Split::North => (
Some(XYWH(x0, y0 + h0 - n, w0, n)),
Some(XYWH(x0, y0, w0, h0 - n)),
Some(XYWH(x0, (y0 + h0).minus(n), w0, n)),
Some(XYWH(x0, y0, w0, h0.minus(n))),
),
Split::West => (
Some(XYWH(x0 + w0 - n, y0, n, h0)),
Some(XYWH(x0, y0, w0 - n, h0)),
Some(XYWH((x0 + w0).minus(n), y0, n, h0)),
Some(XYWH(x0, y0, w0.minus(n), h0)),
),
Split::Above | Split::Below => (
Some(XYWH(x0, y0, w0, h0)),