fixed Map operator!

This commit is contained in:
🪞👃🪞 2025-01-06 23:12:25 +01:00
parent 7ff731133c
commit 38e2e64751
11 changed files with 362 additions and 436 deletions

View file

@ -48,7 +48,7 @@ impl<E, A, B, I, F, G> Content<E> for Map<A, B, I, F, G> where
for item in get_iterator() {
let item = callback(item, index);
//to.place(area.into(), &item);
to.place(to.area().into(), &item);
to.place(item.layout(to.area()), &item);
index += 1;
}
}

View file

@ -57,11 +57,9 @@ transform_xy_unit!(|self: Fixed, area|{
transform_xy_unit!(|self: Shrink, area|Render::layout(&self.content(), [
area.x(), area.y(), area.w().minus(self.dx()), area.h().minus(self.dy())
].into()));
transform_xy_unit!(|self: Expand, area|Render::layout(&self.content(), [
area.x(), area.y(), area.w() + self.dx(), area.h() + self.dy()
].into()));
transform_xy_unit!(|self: Min, area|{
let area = Render::layout(&self.content(), area);
match self {
@ -69,7 +67,6 @@ transform_xy_unit!(|self: Min, area|{
Self::Y(mh, _) => [area.x(), area.y(), area.w(), area.h().max(*mh)],
Self::XY(mw, mh, _) => [area.x(), area.y(), area.w().max(*mw), area.h().max(*mh)]
}});
transform_xy_unit!(|self: Max, area|{
let area = Render::layout(&self.content(), area);
match self {
@ -77,23 +74,20 @@ transform_xy_unit!(|self: Max, area|{
Self::Y(mh, _) => [area.x(), area.y(), area.w(), area.h().min(*mh)],
Self::XY(mw, mh, _) => [area.x(), area.y(), area.w().min(*mw), area.h().min(*mh)],
}});
transform_xy_unit!(|self: Push, area|Render::layout(&self.content(), [
area.x() + self.dx(), area.y() + self.dy(), area.w(), area.h()
].into()));
transform_xy_unit!(|self: Push, area|{
let area = Render::layout(&self.content(), area);
[area.x() + self.dx(), area.y() + self.dy(), area.w(), area.h()]
});
transform_xy_unit!(|self: Pull, area|{
let area = Render::layout(&self.content(), area);
[area.x().minus(self.dx()), area.y().minus(self.dy()), area.w(), area.h()]
});
transform_xy_unit!(|self: Margin, area|{
let area = Render::layout(&self.content(), area);
let dx = self.dx();
let dy = self.dy();
[area.x().minus(dx), area.y().minus(dy), area.w() + dy + dy, area.h() + dy + dy]
});
transform_xy_unit!(|self: Padding, area|{
let area = Render::layout(&self.content(), area);
let dx = self.dx();