+2005-01-11 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Darin.
+
+ - fixed <rdar://problem/3446838> REGRESSION (Mail): text decorations don't print
+ (e.g. <strike>, underline)
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]):
+ This bottleneck routine for drawing a line was setting the linewidth to 0 when
+ the graphics context was not drawing to the screen. Thus, no lines. Now links
+ are underlined when printing from Safari (as well as Mail).
+
2005-01-11 Richard Williamson <rjw@apple.com>
Fixed 3949145. CG has a much faster API for drawing lines.
NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
CGContextRef cgContext;
- float lineWidth;
// This will draw the text from the top of the bounding box down.
// Qt expects to draw from the baseline.
BOOL flag = [graphicsContext shouldAntialias];
- [graphicsContext setShouldAntialias: NO];
-
+ // We don't want antialiased lines on screen, but we do when printing (else they are too thick)
+ if ([graphicsContext isDrawingToScreen]) {
+ [graphicsContext setShouldAntialias:NO];
+ }
+
[color set];
cgContext = (CGContextRef)[graphicsContext graphicsPort];
- lineWidth = 0.0;
- if ([graphicsContext isDrawingToScreen] && lineWidth == 0.0) {
- CGSize size = CGSizeApplyAffineTransform(CGSizeMake(1.0, 1.0), CGAffineTransformInvert(CGContextGetCTM(cgContext)));
- lineWidth = size.width;
- }
-
- CGContextSetLineWidth(cgContext, lineWidth);
+ CGSize size = CGSizeApplyAffineTransform(CGSizeMake(1.0, 1.0), CGAffineTransformInvert(CGContextGetCTM(cgContext)));
+ CGContextSetLineWidth(cgContext, size.width);
#if BUILDING_ON_PANTHER
CGContextMoveToPoint(cgContext, point.x, point.y + [self lineSpacing] + 1.5 - [self descent] + yOffset);