safe subtract in border

This commit is contained in:
facile pop culture reference 2026-08-13 07:43:25 +03:00
parent 1f54140759
commit 3ee25879cd

View file

@ -194,7 +194,7 @@ pub trait BorderStyle: Draw<Tui> + Copy {
let area = to.area();
let style = style.or_else(||self.style_vertical());
let [x, x2, y, y2] = area.lrtb();
let h = y2 - y;
let h = y2.minus(y);
if h > 1 {
for y in y..y2.saturating_sub(1) {
to.blit(&Self::W, x, y, style);