+2005-08-01 John Sullivan <sullivan@apple.com>
+
+ Patch by Trey Matteson <trey@usa.net>
+ Reviewed by me.
+
+ Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4255
+ underlines still print too thick
+
+ The real problem here is that we have code that scales a 0 width line to always
+ be width=1.0 in device space. I'm leaving that in for the screen, but when printing
+ a width of 0.5 looks good.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]):
+
2005-08-01 Eric Seidel <eseidel@apple.com>
Reviewed by darin.
BOOL flag = [graphicsContext shouldAntialias];
- // We don't want antialiased lines on screen, but we do when printing (else they are too thick)
+ // We don't want antialiased lines on screen, but we do when printing (else they are too thick).
if ([graphicsContext isDrawingToScreen]) {
[graphicsContext setShouldAntialias:NO];
}
}
if (thickness == 0.0F) {
- CGSize size = CGSizeApplyAffineTransform(CGSizeMake(1.0F, 1.0F), CGAffineTransformInvert(CGContextGetCTM(cgContext)));
- CGContextSetLineWidth(cgContext, size.width);
+ if ([graphicsContext isDrawingToScreen]) {
+ CGSize size = CGSizeApplyAffineTransform(CGSizeMake(1.0F, 1.0F), CGAffineTransformInvert(CGContextGetCTM(cgContext)));
+ CGContextSetLineWidth(cgContext, size.width);
+ } else {
+ // See bugzilla bug 4255 for details of why we do this when printing
+ CGContextSetLineWidth(cgContext, 0.5F);
+ }
} else {
CGContextSetLineWidth(cgContext, thickness);
}
-
+
// Use CGContextStrokeLineSegments on Tiger. J. Burkey says this will be a big performance win.
// With Q2DX turned on CGContextStrokeLineSegments sometimes fails to draw lines. See 3952084.