diff options
Diffstat (limited to 'src/quick/items/qquickanchors.cpp')
-rw-r--r-- | src/quick/items/qquickanchors.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/quick/items/qquickanchors.cpp b/src/quick/items/qquickanchors.cpp index dfb8ce0a18..e6de648313 100644 --- a/src/quick/items/qquickanchors.cpp +++ b/src/quick/items/qquickanchors.cpp @@ -49,11 +49,7 @@ static inline qreal hcenter(const QQuickItem *item) if (!QQuickAnchorsPrivate::get(anchors)->centerAligned) return width / 2; } - int iw = width; - if (iw % 2) - return (width + 1) / 2; - else - return width / 2; + return qRound(width / 2); } static inline qreal vcenter(const QQuickItem *item) @@ -63,11 +59,7 @@ static inline qreal vcenter(const QQuickItem *item) if (!QQuickAnchorsPrivate::get(anchors)->centerAligned) return height / 2; } - int ih = height; - if (ih % 2) - return (height + 1) / 2; - else - return height / 2; + return qRound(height / 2); } //local position |