[webkit-changes] cvs commit: WebKit/WebCoreSupport.subproj WebTextRenderer.m

John sullivan at opensource.apple.com
Mon Aug 1 14:19:43 PDT 2005


sullivan    05/08/01 14:19:43

  Modified:    .        ChangeLog
               WebCoreSupport.subproj WebTextRenderer.m
  Log:
          Patch by Trey Matteson <trey at 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:]):
  
  Revision  Changes    Path
  1.3274    +15 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3273
  retrieving revision 1.3274
  diff -u -r1.3273 -r1.3274
  --- ChangeLog	1 Aug 2005 19:11:18 -0000	1.3273
  +++ ChangeLog	1 Aug 2005 21:19:40 -0000	1.3274
  @@ -1,3 +1,18 @@
  +2005-08-01  John Sullivan  <sullivan at apple.com>
  +
  +        Patch by Trey Matteson <trey at 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 at apple.com>
   
           Reviewed by darin.
  
  
  
  1.185     +9 -4      WebKit/WebCoreSupport.subproj/WebTextRenderer.m
  
  Index: WebTextRenderer.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebTextRenderer.m,v
  retrieving revision 1.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- WebTextRenderer.m	1 Aug 2005 16:19:49 -0000	1.184
  +++ WebTextRenderer.m	1 Aug 2005 21:19:42 -0000	1.185
  @@ -561,7 +561,7 @@
       
       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];
       }
  @@ -576,12 +576,17 @@
       }
   
       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.
  
  
  



More information about the webkit-changes mailing list