Fixed newline drawing in engine
This commit is contained in:
@@ -64,8 +64,10 @@ impl Engine for Console {
|
|||||||
match inst {
|
match inst {
|
||||||
crate::render::DrawInstruction::Text(point, text) => {
|
crate::render::DrawInstruction::Text(point, text) => {
|
||||||
let (x, y) = (ctx.area.x + point.x, ctx.area.y + point.y);
|
let (x, y) = (ctx.area.x + point.x, ctx.area.y + point.y);
|
||||||
execute!(stdout(), MoveTo(x, y),).unwrap();
|
for (i, line) in text.lines().enumerate() {
|
||||||
print!("{text}");
|
execute!(stdout(), MoveTo(x, y + (i as u16))).unwrap();
|
||||||
|
print!("{line}");
|
||||||
|
}
|
||||||
stdout().flush().unwrap();
|
stdout().flush().unwrap();
|
||||||
}
|
}
|
||||||
crate::render::DrawInstruction::Child(_point, child) => self.draw_context(child),
|
crate::render::DrawInstruction::Child(_point, child) => self.draw_context(child),
|
||||||
|
|||||||
Reference in New Issue
Block a user