Skip to content

Commit 925e110

Browse files
sync: from linuxdeepin/dtkdeclarative
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#510
1 parent 896ea19 commit 925e110

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/private/dquickiconlabel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ static QRectF alignedRect(bool mirrored, Qt::Alignment alignment, const QSizeF &
208208
const qreal w = size.width();
209209
const qreal h = size.height();
210210
if ((alignment & Qt::AlignVCenter) == Qt::AlignVCenter)
211-
y += rectangle.height() / 2 - h / 2;
211+
y += std::round(rectangle.height() / 2 - h / 2);
212212
else if ((alignment & Qt::AlignBottom) == Qt::AlignBottom)
213213
y += rectangle.height() - h;
214214
if ((alignment & Qt::AlignRight) == Qt::AlignRight)
215215
x += rectangle.width() - w;
216216
else if ((alignment & Qt::AlignHCenter) == Qt::AlignHCenter)
217-
x += rectangle.width() / 2 - w / 2;
217+
x += std::round(rectangle.width() / 2 - w / 2);
218218
return QRectF(x, y, w, h);
219219
}
220220

0 commit comments

Comments
 (0)