Fix curr
This commit is contained in:
@@ -43,23 +43,25 @@ impl LayoutItem {
|
|||||||
for item in items {
|
for item in items {
|
||||||
let size = item.get_size();
|
let size = item.get_size();
|
||||||
|
|
||||||
|
let unit_alloc = size.get(allocation, remaining, total_weight);
|
||||||
|
|
||||||
let item_alloc = if is_row {
|
let item_alloc = if is_row {
|
||||||
Rect {
|
Rect {
|
||||||
width: alloc.width,
|
width: alloc.width,
|
||||||
height: size.get(allocation, remaining, total_weight),
|
height: unit_alloc,
|
||||||
x: alloc.x,
|
x: alloc.x,
|
||||||
y: curr,
|
y: curr,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Rect {
|
Rect {
|
||||||
width: size.get(allocation, remaining, total_weight),
|
width: unit_alloc,
|
||||||
height: alloc.height,
|
height: alloc.height,
|
||||||
x: curr,
|
x: curr,
|
||||||
y: alloc.y,
|
y: alloc.y,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
curr += item_alloc.height;
|
curr += unit_alloc;
|
||||||
|
|
||||||
item.allocate(&item_alloc, layout);
|
item.allocate(&item_alloc, layout);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user