mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-02-21 18:49:04 +01:00
wip: refactor(tui): 1 error left
how do i flip buffer
This commit is contained in:
parent
3bdef228e8
commit
8ca90b9aa0
5 changed files with 86 additions and 58 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue