mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
fix text centering!
This commit is contained in:
parent
6746844b7b
commit
1dcce2502f
1 changed files with 4 additions and 2 deletions
|
|
@ -5,7 +5,8 @@ impl Content<TuiOut> for &str {
|
|||
to.center_xy([self.chars().count() as u16, 1])
|
||||
}
|
||||
fn render (&self, to: &mut TuiOut) {
|
||||
to.blit(self, to.area.x(), to.area.y(), None)
|
||||
let [x, y, ..] = Content::layout(self, to.area());
|
||||
to.blit(self, x, y, None)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -14,7 +15,8 @@ impl Content<TuiOut> for String {
|
|||
to.center_xy([self.chars().count() as u16, 1])
|
||||
}
|
||||
fn render (&self, to: &mut TuiOut) {
|
||||
to.blit(self, to.area.x(), to.area.y(), None)
|
||||
let [x, y, ..] = Content::layout(self, to.area());
|
||||
to.blit(self, x, y, None)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue