]> git.saurik.com Git - winterboard.git/blobdiff - Library.mm
Finish re-integrating WinterBoard label code.
[winterboard.git] / Library.mm
index d1cf54ed37bcd9a271ec2e37a7b0c2c7ed2cec84..918978aea13f4c2ed248df6f281142abd952ac80 100644 (file)
@@ -702,7 +702,7 @@ static void $drawLabel$(NSString *label, CGRect rect, NSString *style, NSString
         style = [style stringByAppendingString:custom];
 
     CGSize size = [label sizeWithStyle:style forWidth:rect.size.width];
-    [label drawAtPoint:CGPointMake((rect.size.width - size.width) / 2, 0) withStyle:style];
+    [label drawAtPoint:CGPointMake((rect.size.width - size.width) / 2 + rect.origin.x, rect.origin.y) withStyle:style];
 }
 
 static struct WBStringDrawingState {
@@ -762,7 +762,12 @@ MSInstanceMessageHook7(CGSize, NSString, _drawInRect,withFont,lineBreakMode,alig
 
     NSString *base(state->base_ ?: @"");
     NSString *extra([NSString stringWithFormat:@"text-align: %@", textAlign]);
-    [self drawInRect:rect withStyle:[NSString stringWithFormat:@"%@;%@;%@;%@", [font markupDescription], extra, base, info]];
+
+    if (true)
+        $drawLabel$(self, rect, [NSString stringWithFormat:@"%@;%@", [font markupDescription], base], info);
+    else
+        [self drawInRect:rect withStyle:[NSString stringWithFormat:@"%@;%@;%@;%@", [font markupDescription], extra, base, info]];
+
     return CGSizeZero;
 }