equal
deleted
inserted
replaced
149 QSizeF pixmapSize = pixmapData.size(); |
149 QSizeF pixmapSize = pixmapData.size(); |
150 |
150 |
151 if (alignment & Qt::AlignRight) { |
151 if (alignment & Qt::AlignRight) { |
152 topLeft.setX(rect.right() - pixmapSize.width()); |
152 topLeft.setX(rect.right() - pixmapSize.width()); |
153 } else if (alignment & Qt::AlignHCenter) { |
153 } else if (alignment & Qt::AlignHCenter) { |
154 topLeft.setX(topLeft.x() + (rect.width() - pixmapSize.width()) / 2); |
154 topLeft.setX(topLeft.x() + (qRound(rect.width()) - qRound(pixmapSize.width())) / 2.0f); |
155 } |
155 } |
156 |
156 |
157 if (alignment & Qt::AlignBottom) { |
157 if (alignment & Qt::AlignBottom) { |
158 topLeft.setY(rect.bottom() - pixmapSize.height()); |
158 topLeft.setY(rect.bottom() - pixmapSize.height()); |
159 } else if (alignment & Qt::AlignVCenter) { |
159 } else if (alignment & Qt::AlignVCenter) { |
160 topLeft.setY(topLeft.y() + (rect.height() - pixmapSize.height()) / 2); |
160 topLeft.setY(topLeft.y() + (qRound(rect.height()) - qRound(pixmapSize.height())) / 2.0f); |
161 } |
161 } |
162 |
162 |
163 pixmapIconRenderer->draw(painter, topLeft, clipPath, maskIconData); |
163 pixmapIconRenderer->draw(painter, topLeft, clipPath, maskIconData); |
164 } |
164 } |
165 |
165 |