use contentsrect to calculate window size if baseUnit isn't 1,1

BUG: 283518
icc-effect-5.14.5
Thomas Lübking 2011-11-13 18:38:03 +01:00
parent 252c21e903
commit 011643d983
1 changed files with 6 additions and 2 deletions

View File

@ -158,8 +158,12 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect
dy = r.height() - r2.height();
const QSize baseInc = w->basicUnit();
Q_ASSERT(baseInc.width() && baseInc.height());
myMeasure[1]->setText( i18nc(myResizeString, r.width()/baseInc.width(), r.height()/baseInc.height(), number(dx/baseInc.width()), number(dy/baseInc.height()) ) );
if (baseInc != QSize(1,1)) {
Q_ASSERT(baseInc.width() && baseInc.height());
const QSize csz = w->contentsRect().size();
myMeasure[1]->setText( i18nc(myResizeString, csz.width()/baseInc.width(), csz.height()/baseInc.height(), number(dx/baseInc.width()), number(dy/baseInc.height()) ) );
} else
myMeasure[1]->setText( i18nc(myResizeString, r.width(), r.height(), number(dx), number(dy) ) );
// calc width for bottomright element, superfluous otherwise
dx = r.right() - r2.right();