mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
[window] improve automatic window positions
This commit is contained in:
@@ -265,6 +265,18 @@ fn automatic_area_position(ctx: &Context) -> Pos2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Look for large spaces between columns (empty columns):
|
||||||
|
let mut x = left;
|
||||||
|
for col_bb in &column_bbs {
|
||||||
|
let available = col_bb.left() - x;
|
||||||
|
if available >= 300.0 {
|
||||||
|
return pos2(x, top);
|
||||||
|
}
|
||||||
|
x = col_bb.right() + spacing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Find first column with some available space at the bottom of it:
|
// Find first column with some available space at the bottom of it:
|
||||||
for col_bb in &column_bbs {
|
for col_bb in &column_bbs {
|
||||||
if col_bb.bottom() < ctx.input().screen_size.y * 0.5 {
|
if col_bb.bottom() < ctx.input().screen_size.y * 0.5 {
|
||||||
|
|||||||
Reference in New Issue
Block a user