[window] improve automatic window positions
This commit is contained in:
parent
5bf8051be5
commit
2fa03f9a6c
1 changed files with 12 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue