mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
fix Fixed
This commit is contained in:
parent
01dacd407d
commit
8c28ef2bd7
4 changed files with 31 additions and 29 deletions
|
|
@ -42,23 +42,25 @@ macro_rules! transform_xy_unit {
|
|||
}
|
||||
|
||||
transform_xy_unit!(|self: Fixed, area|{
|
||||
let area = self.content().layout(area);
|
||||
let [x, y, w, h] = self.content().layout(area.center_xy(match self {
|
||||
Self::X(fw, _) => [*fw, area.h()],
|
||||
Self::Y(fh, _) => [area.w(), *fh],
|
||||
Self::XY(fw, fh, _) => [*fw, *fh],
|
||||
}).into()).xywh();
|
||||
match self {
|
||||
Self::X(fw, _) => [area.x(), area.y(), *fw, area.h()],
|
||||
Self::Y(fh, _) => [area.x(), area.y(), area.w(), *fh],
|
||||
Self::XY(fw, fh, _) => [area.x(), area.y(), *fw, *fh], // tagn
|
||||
Self::X(fw, _) => [x, y, *fw, h],
|
||||
Self::Y(fh, _) => [x, y, w, *fh],
|
||||
Self::XY(fw, fh, _) => [x, y, *fw, *fh],
|
||||
}
|
||||
});
|
||||
|
||||
transform_xy_unit!(|self: Shrink, area|{
|
||||
let area = self.content().layout(area);
|
||||
[area.x(), area.y(), area.w().minus(self.dx()), area.h().minus(self.dy())]
|
||||
});
|
||||
transform_xy_unit!(|self: Shrink, area|self.content().layout([
|
||||
area.x(), area.y(), area.w().minus(self.dx()), area.h().minus(self.dy())
|
||||
].into()));
|
||||
|
||||
transform_xy_unit!(|self: Expand, area|{
|
||||
let area = self.content().layout(area);
|
||||
[area.x(), area.y(), area.w() + self.dx(), area.h() + self.dy()]
|
||||
});
|
||||
transform_xy_unit!(|self: Expand, area|self.content().layout([
|
||||
area.x(), area.y(), area.w() + self.dx(), area.h() + self.dy()
|
||||
].into()));
|
||||
|
||||
transform_xy_unit!(|self: Min, area|{
|
||||
let area = self.content().layout(area);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue