Fix title position

This commit is contained in:
nicknase27 committed 2026-09-30 12:01:01 +02:00
1 parent d14b6c750c
commit 57a486f459
2 files changed
+6 -6

No files matched your search

+4 -3
View File
@@ -1,5 +1,6 @@
use crossterm::event::{Event, EventStream, KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
use futures::{FutureExt, StreamExt};
use ratatui::layout::Alignment;
use ratatui::layout::Constraint::Percentage;
use ratatui::layout::HorizontalAlignment::Center;
use ratatui::style::Stylize;
@@ -90,7 +91,7 @@ impl Ball {
self.x_velocity = -0.5;
self.y_velocity = 0.5;
}
}
}
}
#[derive(Debug, Default)]
@@ -233,9 +234,9 @@ impl App {
Gamestate::Playing => {
let canvas = Canvas::default()
.block(Block::bordered().title(format!(
"PongRS | {} - {}",
" PongRS | {} - {} ",
self.player_score, self.enemy_score
)))
)).title_alignment(Alignment::Center))
.x_bounds([X_BOUNDS.0, X_BOUNDS.1])
.y_bounds([Y_BOUNDS.0, Y_BOUNDS.1])
.marker(Marker::Block)