even better bestfit placement. way to go colophon!
This commit is contained in:
parent
18499a6920
commit
e1b78a1f84
1 changed files with 7 additions and 4 deletions
|
@ -391,11 +391,14 @@ Point *Workspace::bestFitPlacement(const Size &win_size, const Rect &space)
|
||||||
//Find first space that fits the window
|
//Find first space that fits the window
|
||||||
best = NULL;
|
best = NULL;
|
||||||
for (siter=spaces.begin(); siter!=spaces.end(); ++siter) {
|
for (siter=spaces.begin(); siter!=spaces.end(); ++siter) {
|
||||||
if ((siter->w() >= win_size.w()) &&
|
if ((siter->w() >= win_size.w()) && (siter->h() >= win_size.h())) {
|
||||||
(siter->h() >= win_size.h()))
|
if (best == NULL)
|
||||||
|
best = siter;
|
||||||
|
else if (win_size.w() * win_size.h() - siter->w() * siter->h() <
|
||||||
|
best->w() + best->h())
|
||||||
best = siter;
|
best = siter;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (best != NULL) {
|
if (best != NULL) {
|
||||||
Point *pt = new Point(best->origin());
|
Point *pt = new Point(best->origin());
|
||||||
if (screen.colPlacementDirection() != BScreen::TopBottom)
|
if (screen.colPlacementDirection() != BScreen::TopBottom)
|
||||||
|
|
Loading…
Reference in a new issue