1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Make Region::child_bounds private

This commit is contained in:
Emil Ernerfeldt
2020-05-05 08:15:20 +02:00
parent 2f9e70febf
commit fade508c15
4 changed files with 33 additions and 11 deletions

View File

@@ -120,9 +120,11 @@ impl CollapsingHeader {
let top_left = child_region.top_left();
add_contents(child_region);
// Pretend children took up less space than they did:
child_region.child_bounds.max.y =
child_region.child_bounds.max.y.min(top_left.y + max_height);
// Pretend children took up less space:
let mut child_bounds = child_region.child_bounds();
child_bounds.max.y = child_bounds.max.y.min(top_left.y + max_height);
child_region.force_set_child_bounds(child_bounds);
});
} else if state.open {
region.indent(id, add_contents);

View File

@@ -35,9 +35,7 @@ impl Frame {
},
);
// TODO: move up corsor?
region
.child_bounds
.extend_with(child_region.child_bounds.max + margin);
region.expand_to_include_child(child_region.rect().expand2(margin));
// TODO: move up cursor?
}
}