From 833bf385773c27b838c8c219175f6af4eb643f4e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 20 Sep 2012 20:35:15 +0000 Subject: [PATCH] Improve debug logging for the WB style machine. --- Library.mm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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() { -- 2.47.2