[window] improve automatic window positions

This commit is contained in:
Emil Ernerfeldt 2020-06-03 10:59:31 +02:00
parent 5bf8051be5
commit 2fa03f9a6c

View file

@ -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:
for col_bb in &column_bbs {
if col_bb.bottom() < ctx.input().screen_size.y * 0.5 {