From eafd887f9c6190fccb2f01dacefaada9f7d49daa Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 3 Jan 2018 13:10:55 +0100 Subject: [PATCH] rounding issues when aligning QRects fixed ( no more jumping SVGs when changing skins ) --- src/common/QskFunctions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/QskFunctions.cpp b/src/common/QskFunctions.cpp index a6dd440b..56f8492c 100644 --- a/src/common/QskFunctions.cpp +++ b/src/common/QskFunctions.cpp @@ -26,7 +26,8 @@ static inline Rect qskAlignedRect( const Rect& outerRect, } default: { - r.moveLeft( outerRect.center().x() - width / 2 ); + const auto dx = ( outerRect.width() - width ) / 2; + r.moveLeft( outerRect.left() + dx ); } } @@ -44,7 +45,8 @@ static inline Rect qskAlignedRect( const Rect& outerRect, } default: { - r.moveTop( outerRect.center().y() - height / 2 ); + const auto dy = ( outerRect.height() - height ) / 2; + r.moveTop( outerRect.top() + dy ); } }