Changeset 23761 in webkit


Ignore:
Timestamp:
Jun 25, 2007 3:29:03 AM (17 years ago)
Author:
bdash
Message:

2007-06-25 Mitz Pettel <mitz@webkit.org>

Reviewed by Darin.

Test: fast/inline/br-text-decoration.html

  • platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawLineForText): Added an early return if the line width is zero. Also changed the line stroke to a rect fill, so that lines with length shorter than their thickness paint correctly.

2007-06-25 Mitz Pettel <mitz@webkit.org>

Reviewed by Darin.

  • fast/inline/br-text-decoration-expected.checksum: Added.
  • fast/inline/br-text-decoration-expected.png: Added.
  • fast/inline/br-text-decoration-expected.txt: Added.
  • fast/inline/br-text-decoration.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r23760 r23761  
     12007-06-25  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=14245
     6          Underline painted under <br>, not repainted properly
     7
     8        * fast/inline/br-text-decoration-expected.checksum: Added.
     9        * fast/inline/br-text-decoration-expected.png: Added.
     10        * fast/inline/br-text-decoration-expected.txt: Added.
     11        * fast/inline/br-text-decoration.html: Added.
     12
    1132007-06-25  Matt Perry  <mpComplete@gmail.com>
    214
  • trunk/WebCore/ChangeLog

    r23759 r23761  
     12007-06-25  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=14245
     6          Underline painted under <br>, not repainted properly
     7
     8        Test: fast/inline/br-text-decoration.html
     9
     10        * platform/graphics/cg/GraphicsContextCG.cpp:
     11        (WebCore::GraphicsContext::drawLineForText): Added an early return if the line width
     12        is zero. Also changed the line stroke to a rect fill, so that lines with length shorter
     13        than their thickness paint correctly.
     14
    1152007-06-25  Mitz Pettel  <mitz@webkit.org>
    216
  • trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

    r21719 r23761  
    708708        return;
    709709
     710    if (width <= 0)
     711        return;
     712
    710713    CGContextSaveGState(platformContext());
    711714
     
    736739    }
    737740   
    738     CGContextSetLineWidth(platformContext(), thickness);
    739 
    740     float halfThickness = thickness / 2;
    741 
    742     // FIXME: How about using a rectangle fill instead of drawing a line?
    743     CGPoint linePoints[2];
    744     linePoints[0].x = x + halfThickness;
    745     linePoints[0].y = y + halfThickness;
    746     linePoints[1].x = x + lineLength - halfThickness;
    747     linePoints[1].y = y + halfThickness;
    748     CGContextStrokeLineSegments(platformContext(), linePoints, 2);
     741    if (fillColor() != strokeColor())
     742        setCGFillColor(platformContext(), strokeColor());
     743    CGContextFillRect(platformContext(), CGRectMake(x, y, lineLength, thickness));
    749744
    750745    CGContextRestoreGState(platformContext());
Note: See TracChangeset for help on using the changeset viewer.