Author: mir3x
Date: Tue Feb  7 16:59:26 2017
New Revision: 34990

URL: http://svn.gna.org/viewcvs/freeciv?rev=34990&view=rev
Log:
Qt client - crop scaled hex sprites bigger by 1 pixel for scaled tileset.

See gna patch #8110


Modified:
    branches/S3_0/client/gui-qt/sprite.cpp

Modified: branches/S3_0/client/gui-qt/sprite.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/sprite.cpp?rev=34990&r1=34989&r2=34990&view=diff
==============================================================================
--- branches/S3_0/client/gui-qt/sprite.cpp      (original)
+++ branches/S3_0/client/gui-qt/sprite.cpp      Tue Feb  7 16:59:26 2017
@@ -104,15 +104,19 @@
   sprite *cropped;
   int widthzoom;
   int heightzoom;
+  int hex = 0;
 
   fc_assert_ret_val(source, NULL);
 
   if (!width || !height) {
     return NULL;
   }
-
-  widthzoom = ceil(width * scale);
-  heightzoom = ceil(height * scale);
+  if (scale != 1.0f && (tileset_hex_height(tileset) > 0
+      || tileset_hex_width(tileset) > 0)) {
+    hex = 1;
+  }
+  widthzoom = ceil(width * scale) + hex;
+  heightzoom = ceil(height * scale) + hex;
   cropped = new sprite;
   cropped->pm = new QPixmap(widthzoom, heightzoom);
   cropped->pm->fill(Qt::transparent);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to