trying to add skinny black borders around things

This commit is contained in:
🪞👃🪞 2025-01-11 04:26:13 +01:00
parent 9035353893
commit 1fe60bff5f
9 changed files with 845 additions and 532 deletions

View file

@ -5,7 +5,7 @@ pub fn map_south<O: Output>(
item_height: O::Unit,
item: impl Content<O>
) -> impl Content<O> {
Push::y(item_offset, Align::n(Fixed::y(item_height, Align::n(Fill::x(item)))))
Push::y(item_offset, Fixed::y(item_height, Fill::x(item)))
}
pub fn map_south_west<O: Output>(
@ -52,8 +52,7 @@ impl<'a, E, A, B, I, F, G> Content<E> for Map<'a, A, B, I, F, G> where
let [mut min_x, mut min_y] = area.center();
let [mut max_x, mut max_y] = area.center();
for item in get_iterator() {
let area = callback(item, index).layout(area).xywh();
let [x,y,w,h] = area.xywh();
let [x,y,w,h] = callback(item, index).layout(area).xywh();
min_x = min_x.min(x.into());
min_y = min_y.min(y.into());
max_x = max_x.max((x + w).into());
@ -68,11 +67,11 @@ impl<'a, E, A, B, I, F, G> Content<E> for Map<'a, A, B, I, F, G> where
fn render (&self, to: &mut E) {
let Self(_, get_iterator, callback) = self;
let mut index = 0;
//let area = self.layout(to.area());
let area = Content::layout(self, to.area());
for item in get_iterator() {
let item = callback(item, index);
//to.place(area.into(), &item);
to.place(item.layout(to.area()), &item);
to.place(item.layout(area), &item);
index += 1;
}
}