src/hbcore/image/hbsgimageiconimpl_p.cpp
changeset 30 80e4d18b72f5
parent 28 b7da29130b0e
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
   306 {
   306 {
   307     QPointF topLeft = rect.topLeft();
   307     QPointF topLeft = rect.topLeft();
   308     if (alignment & Qt::AlignRight) {
   308     if (alignment & Qt::AlignRight) {
   309         topLeft.setX(rect.right() - renderSize.width());
   309         topLeft.setX(rect.right() - renderSize.width());
   310     } else if (alignment & Qt::AlignHCenter) {
   310     } else if (alignment & Qt::AlignHCenter) {
   311         topLeft.setX(topLeft.x() + (rect.width() - renderSize.width()) / 2);
   311         topLeft.setX(topLeft.x() + (qRound(rect.width()) - qRound(renderSize.width())) / 2.0f);
   312     }
   312     }
   313 
   313 
   314     if (alignment & Qt::AlignBottom) {
   314     if (alignment & Qt::AlignBottom) {
   315         topLeft.setY(rect.bottom() - renderSize.height());
   315         topLeft.setY(rect.bottom() - renderSize.height());
   316     } else if (alignment & Qt::AlignVCenter) {
   316     } else if (alignment & Qt::AlignVCenter) {
   317         topLeft.setY(topLeft.y() + (rect.height() - renderSize.height()) / 2);
   317         topLeft.setY(topLeft.y() + (qRound(rect.height()) - qRound(renderSize.height())) / 2.0f);
   318     }
   318     }
   319     return topLeft;
   319     return topLeft;
   320 }
   320 }
   321 
   321 
   322 VGImage HbSgimageIconImpl::getVgImageFromSgImage()
   322 VGImage HbSgimageIconImpl::getVgImageFromSgImage()