From: Jay Freeman (saurik) Date: Thu, 20 Sep 2012 20:35:15 +0000 (+0000) Subject: Improve debug logging for the WB style machine. X-Git-Tag: v0.9.3906~7 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/833bf385773c27b838c8c219175f6af4eb643f4e Improve debug logging for the WB style machine. --- diff --git a/Library.mm b/Library.mm index 0897249..9b55a3b 100644 --- a/Library.mm +++ b/Library.mm @@ -1998,23 +1998,24 @@ static void NSString$drawAtPoint$withStyle$(NSString *self, SEL _cmd, CGPoint po WKSetCurrentGraphicsContext(UIGraphicsGetCurrentContext()); if (style == nil || [style length] == 0) style = @"font-family: Helvetica; font-size: 12px"; - //NSLog(@"XXX:drawP(%@)", [style stringByReplacingOccurrencesOfString:@"\n" withString:@" "]); - return [[WBMarkup sharedMarkup] drawString:self atPoint:point withStyle:style]; + //NSLog(@"XXX:drawP(%@ | %@)", self, [style stringByReplacingOccurrencesOfString:@"\n" withString:@" "]); + [[WBMarkup sharedMarkup] drawString:self atPoint:point withStyle:style]; } static void NSString$drawInRect$withStyle$(NSString *self, SEL _cmd, CGRect rect, NSString *style) { WKSetCurrentGraphicsContext(UIGraphicsGetCurrentContext()); if (style == nil || [style length] == 0) style = @"font-family: Helvetica; font-size: 12px"; - //NSLog(@"XXX:drawR(%@)", [style stringByReplacingOccurrencesOfString:@"\n" withString:@" "]); + //NSLog(@"XXX:drawR(%@ | %@)", self, [style stringByReplacingOccurrencesOfString:@"\n" withString:@" "]); return [[WBMarkup sharedMarkup] drawString:self inRect:rect withStyle:style]; } static CGSize NSString$sizeWithStyle$forWidth$(NSString *self, SEL _cmd, NSString *style, float width) { if (style == nil || [style length] == 0) style = @"font-family: Helvetica; font-size: 12px"; - //NSLog(@"XXX:size(%@)", [style stringByReplacingOccurrencesOfString:@"\n" withString:@" "]); - return [[WBMarkup sharedMarkup] sizeOfString:self withStyle:style forWidth:width]; + CGSize size([[WBMarkup sharedMarkup] sizeOfString:self withStyle:style forWidth:width]); + //NSLog(@"XXX:size(%@ | %@) = [%g %g]", self, [style stringByReplacingOccurrencesOfString:@"\n" withString:@" "], size.width, size.height); + return size; } static void SBInitialize() {