project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
changeset 6209 074ab6ebcb3e
parent 6078 8c0cc07731e5
child 6657 e1125559359f
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Tue Oct 25 22:51:10 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Wed Oct 26 00:30:35 2011 +0200
@@ -163,10 +163,11 @@
             weaponCell.delegate = self;
         }
 
-        int size = 32 * [[UIScreen mainScreen] scale];
-        int corners = 8 * [[UIScreen mainScreen] scale];
-        int x = ((row*size)/(int)(self.ammoStoreImage.size.height * [[UIScreen mainScreen] scale]))*size;
-        int y = (row*size)%(int)(self.ammoStoreImage.size.height * [[UIScreen mainScreen] scale]);
+        CGFloat theScale = [[UIScreen mainScreen] safeScale];
+        int size = 32 * theScale;
+        int corners = 8 * theScale;
+        int x = ((row*size)/(int)(self.ammoStoreImage.size.height * theScale))*size;
+        int y = (row*size)%(int)(self.ammoStoreImage.size.height * theScale);
 
         UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, size, size)] makeRoundCornersOfSize:CGSizeMake(corners, corners)];
         weaponCell.weaponIcon.image = img;