summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qrubberband.h
diff options
context:
space:
mode:
authorEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-11-18 20:15:23 (GMT)
committerEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-11-27 19:19:09 (GMT)
commitf2eeef396296a3563c006b77c0ce3708d6256bd3 (patch)
treec4b5a4d920cf970de715e378daa6c34183ff3949 /src/gui/widgets/qrubberband.h
parent7fbb8aae666a86091cb7f7f3326e9e05781c02f3 (diff)
downloadQt-f2eeef396296a3563c006b77c0ce3708d6256bd3.zip
Qt-f2eeef396296a3563c006b77c0ce3708d6256bd3.tar.gz
Qt-f2eeef396296a3563c006b77c0ce3708d6256bd3.tar.bz2
QGAL: Refactor solvePreferred to support min/maxPrefSize
With the addition of min and maxPrefSizeHints, the logic used in the preferred simplex had to be changed. The concept behind it is still the same, we minimize the deviation from each item's preferred size. Previously we would make an special effort to avoid items being shrunk, that's why the "shinker" simplex variables had larger multipliers in the objective function. Now we still have variables with large multipliers and others with small mutlipliers, but rather than differentiating between shrinker and/or grower variables, we classify them as "soft" or "hard". "Soft" variables, or slacks, are those that allow the anchor to change its value up to the minPref or maxPref boundaries, OTOH, "hard" slacks are those that allow the item to go all the way to its minimum or maximum sizes. Naturally, the "hard" slacks get large coeficients in the objective function while the "soft" ones get small ones. Now all the slack variables are restricted in size as to respect the boundaries of each interval: - Minimum to MinimumPreferred, - MinimumPreferred to Preferred, - Preferred to MaximumPreferred and - MaximumPreferred to Maximum With such limits, the SizeHint constraints became redundant in the calculation of preferred sizes so they are no longer used. Additionally, as an optimization, if a given interval is NULL (for instance, MinimumPreferred is equal to Preferred), then the associated slack variable would have its size restricted to zero, therefore it is not created at all. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Diffstat (limited to 'src/gui/widgets/qrubberband.h')
0 files changed, 0 insertions, 0 deletions