mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
fix and test alignments
This commit is contained in:
parent
9125e04e07
commit
3c14456566
8 changed files with 135 additions and 100 deletions
|
|
@ -8,7 +8,7 @@ pub trait Output<E: Engine> {
|
|||
fn area (&self) -> E::Area;
|
||||
/// Mutable pointer to area
|
||||
fn area_mut (&mut self) -> &mut E::Area;
|
||||
///// Render widget in area
|
||||
/// Render widget in area
|
||||
fn place (&mut self, area: E::Area, content: &impl Content<E>);
|
||||
|
||||
#[inline] fn x (&self) -> E::Unit { self.area().x() }
|
||||
|
|
|
|||
|
|
@ -9,14 +9,10 @@ impl Output<Tui> for TuiOut {
|
|||
#[inline] fn area (&self) -> [u16;4] { self.area }
|
||||
#[inline] fn area_mut (&mut self) -> &mut [u16;4] { &mut self.area }
|
||||
#[inline] fn place (&mut self, area: [u16;4], content: &impl Content<Tui>) {
|
||||
let last = self.area().xywh().clone();
|
||||
//panic!("a {last:?} {area:?} {:?}", self.area);
|
||||
*self.area_mut() = area.xywh().clone();
|
||||
//panic!("b {last:?} {area:?} {:?}", self.area);
|
||||
let last = self.area();
|
||||
*self.area_mut() = area;
|
||||
content.render(self);
|
||||
//panic!("c {last:?} {area:?} {:?}", self.area);
|
||||
*self.area_mut() = last;
|
||||
//panic!("placed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue