diff --git a/scene_opengl.cpp b/scene_opengl.cpp --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -2248,12 +2248,14 @@ const QRectF outerRect(QPointF(-leftOffset(), -topOffset()), QPointF(topLevel()->width() + rightOffset(), topLevel()->height() + bottomOffset())); - const int width = qMax(topLeft.width(), bottomLeft.width()) + - qMax(top.width(), bottom.width()) + - qMax(topRight.width(), bottomRight.width()); - const int height = qMax(topLeft.height(), topRight.height()) + - qMax(left.height(), right.height()) + - qMax(bottomLeft.height(), bottomRight.height()); + const int width = qMax(left.width() + right.width(), + qMax(topLeft.width(), bottomLeft.width()) + + qMax(top.width(), bottom.width()) + + qMax(topRight.width(), bottomRight.width())); + const int height = qMax(top.height() + bottom.height(), + qMax(topLeft.height(), topRight.height()) + + qMax(left.height(), right.height()) + + qMax(bottomLeft.height(), bottomRight.height())); qreal tx1(0.0), tx2(0.0), ty1(0.0), ty2(0.0); @@ -2355,13 +2357,15 @@ const QSize topLeft(shadowPixmap(ShadowElementTopLeft).size()); const QSize bottomRight(shadowPixmap(ShadowElementBottomRight).size()); - const int width = qMax(topLeft.width(), bottomLeft.width()) + - qMax(top.width(), bottom.width()) + - qMax(topRight.width(), bottomRight.width()); + const int width = qMax(left.width() + right.width(), + qMax(topLeft.width(), bottomLeft.width()) + + qMax(top.width(), bottom.width()) + + qMax(topRight.width(), bottomRight.width())); - const int height = qMax(topRight.height(), topLeft.height()) + - qMax(left.height(), right.height()) + - qMax(bottomLeft.height(), bottomRight.height()); + const int height = qMax(top.height() + bottom.height(), + qMax(topRight.height(), topLeft.height()) + + qMax(left.height(), right.height()) + + qMax(bottomLeft.height(), bottomRight.height())); if (width == 0 || height == 0) { return false;