fix deal crash
This commit is contained in:
parent
759ff410c2
commit
65ea256436
6 changed files with 15 additions and 55 deletions
|
|
@ -13,26 +13,9 @@ pub(crate) fn draw_ingame(
|
|||
use ratatui::layout::Flex;
|
||||
use ratatui::prelude::*;
|
||||
|
||||
// let title = ratatui::text::Text::raw("tiny riichi");
|
||||
|
||||
// let wall = if let Some(wall_tiles) = wall_tiles {
|
||||
// let wall_tiles = wall_tiles
|
||||
// .iter()
|
||||
// .map(|inwall| -> Result<_> { Ok(tiles.get(inwall).map(tiles::draw_tile)?) })
|
||||
// .collect::<Result<Vec<_>>>()?;
|
||||
|
||||
// // let paragraph = Paragraph::new(wall.join(", ")).wrap(ratatui::widgets::Wrap { trim: true });
|
||||
// Some(wall_tiles)
|
||||
// } else {
|
||||
// None
|
||||
// };
|
||||
|
||||
tui_ctx.draw(|frame| {
|
||||
// frame.render_widget(title, frame.area());
|
||||
debug!("{}", frame.area());
|
||||
|
||||
// if let Some(wall) = wall {
|
||||
// // let tile_area = Rect::new(0, 0, 5, 4);
|
||||
let layout = Layout::horizontal(vec![Constraint::Max(5); 13]).flex(Flex::Start);
|
||||
let mut area = frame.area();
|
||||
area.height = 4;
|
||||
|
|
@ -40,13 +23,6 @@ pub(crate) fn draw_ingame(
|
|||
for (tile, area) in rendered_hand.0.iter().zip(areas.iter()) {
|
||||
frame.render_widget(tile, *area);
|
||||
}
|
||||
|
||||
// // debug!("wall.len(): {}, areas.len(): {}", wall.len(), areas.len());
|
||||
// for (tile, rect) in wall.iter().zip(areas.iter()) {
|
||||
// // debug!("{rect:?}");
|
||||
// frame.render_widget(tile, *rect);
|
||||
// }
|
||||
// }
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue