Commits

kantacki  committed 964bba6

Small fixups for scalling images

  • Participants
  • Parent commits 9fb330f

Comments (0)

Files changed (1)

File ImageData.cpp

   halfSize_ = size/2;
 
   for (int i=0; i<SMALL_STONES; i++) {
-    image2pixmap(images_[i].scaled(halfSize_, halfSize_), smallStone_xpm_[i]);
+    image2pixmap(images_[i].scaled(halfSize_, halfSize_, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), smallStone_xpm_[i]);
 //     smallStone_xpm_[i].convertFromImage(images_[i].smoothScale(halfSize_, halfSize_), QPixmap::ColorOnly|QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither|QPixmap::AvoidDither);
   }
 
   for (int i=0; i<LARGE_STONES; i++) {
-    image2pixmap(images_[SMALL_STONES+i].scaled(size_, halfSize_), largeStone_xpm_[i]);
+    image2pixmap(images_[SMALL_STONES+i].scaled(size_, halfSize_, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), largeStone_xpm_[i]);
 //     largeStone_xpm_[i].convertFromImage(images_[SMALL_STONES+i].smoothScale(size_, halfSize_) , QPixmap::ColorOnly|QPixmap::DiffuseDither|QPixmap::DiffuseAlphaDither|QPixmap::AvoidDither);
   }
 
-  objectImg_ = images_[SMALL_STONES+LARGE_STONES].scaled(size_, size_);
+  objectImg_ = images_[SMALL_STONES+LARGE_STONES].scaled(size_, size_, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
   
   // Use copy() because if the size is not changed, smoothScale is not
   // really a copy
   brighten(objectImg_);
   image2pixmap(objectImg_, brightObject_, false);
 
-  QImage img = images_[SMALL_STONES+LARGE_STONES+1].scaled(size_, size_);
+  QImage img = images_[SMALL_STONES+LARGE_STONES+1].scaled(size_, size_, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
   if (img.width() == size_) img = img.copy();
 
   image2pixmap(img, otherPixmaps_[1], false);
   image2pixmap(img, brightTreasure_, false);
 
   for (int i=2; i<OTHER_IMAGES; i++) {
-    image2pixmap(images_[SMALL_STONES+LARGE_STONES+i].scaled(size_, size_), otherPixmaps_[i]);
+    image2pixmap(images_[SMALL_STONES+LARGE_STONES+i].scaled(size_, size_, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), otherPixmaps_[i]);
 //     otherPixmaps_[i].convertFromImage(images_[SMALL_STONES+LARGE_STONES+i].smoothScale(size_, size_), QPixmap::ColorOnly|QPixmap::OrderedDither|QPixmap::OrderedAlphaDither|QPixmap::AvoidDither);
   }
   floor_ = floor_.scaled(size_, size_);