project_files/HedgewarsMobile/Classes/UIImageExtra.m
changeset 6080 ce02ddfe8aa1
parent 6078 8c0cc07731e5
child 6209 074ab6ebcb3e
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Sun Oct 02 01:35:20 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Sun Oct 02 03:45:09 2011 +0200
@@ -51,15 +51,16 @@
     CGFloat screenScale = [[UIScreen mainScreen] scale];
     int w = self.size.width * screenScale;
     int h = self.size.height * screenScale;
-    
+    int yOffset = self.size.height - secondImage.size.height + secondImagePoint.y;
+
     if (w == 0 || h == 0) {
-        DLog(@"Can have 0 dimesions");
+        DLog(@"Cannot have 0 dimesions");
         return self;
     }
     
     // Create a bitmap graphics context; this will also set it as the current context
     CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
-    CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);
+    CGContextRef context = CGBitmapContextCreate(NULL, w, h+yOffset, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);
     
     // draw the two images in the current context
     CGContextDrawImage(context, CGRectMake(0, 0, self.size.width*screenScale, self.size.height*screenScale), [self CGImage]);