From 011643d983ec29ff9c614d4035091101165d409c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 13 Nov 2011 18:38:03 +0100 Subject: [PATCH] use contentsrect to calculate window size if baseUnit isn't 1,1 BUG: 283518 --- effects/windowgeometry/windowgeometry.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/effects/windowgeometry/windowgeometry.cpp b/effects/windowgeometry/windowgeometry.cpp index 43de301183..a9fd796a63 100644 --- a/effects/windowgeometry/windowgeometry.cpp +++ b/effects/windowgeometry/windowgeometry.cpp @@ -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();