drawing and singing fixes

This commit is contained in:
facile pop culture reference 2026-06-24 06:37:07 +03:00
parent e0781571c4
commit 0273d2ac75
7 changed files with 244 additions and 195 deletions

View file

@ -1,6 +1,20 @@
use super::*;
/// Iterate over a collection of renderables:
/// Iterate over a collection of the same kind of [Draw]able:
pub fn iter <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}
/// Iterate over a collection of the same kind of [Draw]able:
pub fn iter_once <'a, S: Screen, D: 'a, U: Draw<S>> (
_iter: impl Iterator<Item = D>, _draw: impl Fn(D, usize)->U,
) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}
/// Iterate over a collection of various [Draw]ables:
///
/// ```
/// use tengri::draw::{Origin::*, Split::*};
@ -20,12 +34,6 @@ pub fn iter_dyn <
thunk(move|_to: &mut S|{ todo!() })
}
pub fn iter <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}
pub fn iter_north <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
) -> impl Draw<S> {
@ -61,3 +69,27 @@ pub fn iter_west <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}
pub fn row_south <S: Screen> (south: S::Unit, height: S::Unit, content: impl Draw<S>)
-> impl Draw<S>
{
y_push(south, h_exact(height, content))
}
pub fn row_north <S: Screen> (north: S::Unit, height: S::Unit, content: impl Draw<S>)
-> impl Draw<S>
{
y_pull(north, h_exact(height, content))
}
pub fn col_east <S: Screen> (east: S::Unit, width: S::Unit, content: impl Draw<S>)
-> impl Draw<S>
{
x_push(east, h_exact(width, content))
}
pub fn col_west <S: Screen> (west: S::Unit, width: S::Unit, content: impl Draw<S>)
-> impl Draw<S>
{
x_pull(west, h_exact(width, content))
}