wip: refactor(tui): 1 error left

how do i flip buffer
This commit is contained in:
same mf who else 2026-02-20 00:28:56 +02:00
parent 3bdef228e8
commit 8ca90b9aa0
5 changed files with 86 additions and 58 deletions

View file

@ -58,7 +58,7 @@ pub trait BorderStyle: Content<TuiOut> + Copy {
}
#[inline] fn draw_horizontal (
&self, to: &mut TuiOut, style: Option<Style>
) -> Usually<[u16;4]> {
) -> Usually<XYWH<u16>> {
let area = to.area();
let style = style.or_else(||self.style_horizontal());
let [x, x2, y, y2] = area.lrtb();
@ -70,7 +70,7 @@ pub trait BorderStyle: Content<TuiOut> + Copy {
}
#[inline] fn draw_vertical (
&self, to: &mut TuiOut, style: Option<Style>
) -> Usually<[u16;4]> {
) -> Usually<XYWH<u16>> {
let area = to.area();
let style = style.or_else(||self.style_vertical());
let [x, x2, y, y2] = area.lrtb();
@ -88,10 +88,10 @@ pub trait BorderStyle: Content<TuiOut> + Copy {
}
#[inline] fn draw_corners (
&self, to: &mut TuiOut, style: Option<Style>
) -> Usually<[u16;4]> {
) -> Usually<XYWH<u16>> {
let area = to.area();
let style = style.or_else(||self.style_corners());
let [x, y, width, height] = area.xywh();
let XYWH(x, y, width, height) = area;
if width > 1 && height > 1 {
to.blit(&Self::NW, x, y, style);
to.blit(&Self::NE, x + width - 1, y, style);