mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-07-17 15:56:57 +02:00
This commit is contained in:
parent
30d378a6ee
commit
bea88ac58d
5 changed files with 27 additions and 15 deletions
|
|
@ -35,7 +35,7 @@ impl Y<u16> for Tui {
|
|||
fn h (&self) -> u16 { self.1.3 }
|
||||
}
|
||||
impl Tui {
|
||||
fn update (&mut self, callback: &impl Fn(&mut Cell, u16, u16)) -> XYWH<u16> {
|
||||
pub fn update (&mut self, callback: &impl Fn(&mut Cell, u16, u16)) -> XYWH<u16> {
|
||||
for row in 0..self.h() {
|
||||
let y = self.y() + row;
|
||||
for col in 0..self.w() {
|
||||
|
|
@ -49,14 +49,14 @@ impl Tui {
|
|||
}
|
||||
self.xywh()
|
||||
}
|
||||
fn tint_all (&mut self, fg: Color, bg: Color, modifier: Modifier) {
|
||||
pub fn tint_all (&mut self, fg: Color, bg: Color, modifier: Modifier) {
|
||||
for cell in self.0.content.iter_mut() {
|
||||
cell.fg = fg;
|
||||
cell.bg = bg;
|
||||
cell.modifier = modifier;
|
||||
}
|
||||
}
|
||||
fn blit (&mut self, text: &impl AsRef<str>, x: u16, y: u16, style: Option<Style>) {
|
||||
pub fn blit (&mut self, text: &impl AsRef<str>, x: u16, y: u16, style: Option<Style>) {
|
||||
let text = text.as_ref();
|
||||
let style = style.unwrap_or(Style::default());
|
||||
if x < self.0.area.width && y < self.0.area.height {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue