From 8b0e484114262e4bcda467ede9dc8bbcd972070f Mon Sep 17 00:00:00 2001 From: unspeaker Date: Fri, 25 Apr 2025 14:00:12 +0300 Subject: [PATCH] sampler_view: use Map::east/south --- crates/sampler/src/sampler_view.rs | 19 +++++++++++++++---- deps/tengri | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/crates/sampler/src/sampler_view.rs b/crates/sampler/src/sampler_view.rs index de81619c..e50c925d 100644 --- a/crates/sampler/src/sampler_view.rs +++ b/crates/sampler/src/sampler_view.rs @@ -2,10 +2,21 @@ use crate::*; impl Sampler { pub fn view_grid (&self) -> impl Content { - let pos = |x|Align::c(Fixed::xy(64, 32, Align::nw(x))); - pos(Map::new(||0..8u16, |x, _|Map::new(||0..8u16, move|y, _|{ - Pull::x(2, Push::xy(x * 5, y * 2, Tui::bg(Color::Black, "SMPL"))) - }))) + let cells_x = 8u16; + let cells_y = 8u16; + let cell_width = 8u16; + let cell_height = 2u16; + let width = cells_x * cell_width; + let height = cells_y * cell_height; + let pos = |a|Align::c(Tui::bg(Color::Black, Fixed::xy(width, height, a))); + let cell = move|y, _|Fixed::xy(cell_width, cell_height, "x"); + let rows = move|x, _|Map::south(cell_height, move||0..cells_y, cell); + let cols = Map::east(cell_width, move||0..cells_x, rows); + pos(cols) + //Fixed::xy(cell_width, 2, Bsp::s( + //format!("{x}x{y}"), + //RepeatH(Phat::<()>::HI), + //))))))))) } } diff --git a/deps/tengri b/deps/tengri index 4e811f63..d84bfda8 160000 --- a/deps/tengri +++ b/deps/tengri @@ -1 +1 @@ -Subproject commit 4e811f63f149c662e0c3ed25138475b9a2c802ac +Subproject commit d84bfda8408d5a1906d4c9951f00e961d9c273ce