From de679878b7397d13c743a6bff9426593172de286 Mon Sep 17 00:00:00 2001 From: czeidler Date: Sat, 1 Sep 2012 15:45:59 +1200 Subject: [PATCH] Ceil and floor min and max size respectively gives better results. --- src/libs/alm/SharedSolver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/alm/SharedSolver.cpp b/src/libs/alm/SharedSolver.cpp index f46da7e997..10a83d0a04 100644 --- a/src/libs/alm/SharedSolver.cpp +++ b/src/libs/alm/SharedSolver.cpp @@ -38,8 +38,8 @@ struct SharedSolver::MinSizeValidator { if (solveResult == LinearProgramming::kUnbounded) { solver->SetMinSize(layout, BSize(0, 0)); } else { - solver->SetMinSize(layout, BSize(layout->Right()->Value(), - layout->Bottom()->Value())); + solver->SetMinSize(layout, BSize(ceilf(layout->Right()->Value()), + ceilf(layout->Bottom()->Value()))); } } }; @@ -58,8 +58,8 @@ struct SharedSolver::MaxSizeValidator { solver->SetMaxSize(layout, BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED)); } else { - solver->SetMaxSize(layout, BSize(layout->Right()->Value(), - layout->Bottom()->Value())); + solver->SetMaxSize(layout, BSize(floorf(layout->Right()->Value()), + floorf(layout->Bottom()->Value()))); } } };