⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 112061 in webkit


Ignore:
Timestamp:
Mar 26, 2012, 1:35:42 AM (15 years ago)
Author:
leviw@chromium.org
Message:

Second round of RenderListMarker cleanup. Properly measuring text with integers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.cpp

    r111854 r112061  
    11111111        return;
    11121112
    1113     IntPoint boxOrigin(roundedIntPoint(paintOffset + location()));
    1114     IntRect overflowRect(pixelSnappedIntRect(visualOverflowRect()));
     1113    LayoutPoint boxOrigin(paintOffset + location());
     1114    LayoutRect overflowRect(visualOverflowRect());
    11151115    overflowRect.moveBy(boxOrigin);
    11161116    overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
    11171117
    1118     if (!paintInfo.rect.intersects(overflowRect))
     1118    if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect)))
    11191119        return;
    11201120
    1121     IntRect box(boxOrigin, frameRect().pixelSnappedSize());
     1121    LayoutRect box(boxOrigin, size());
    11221122   
    11231123    IntRect marker = getRelativeMarkerRect();
    1124     marker.moveBy(boxOrigin);
     1124    marker.moveBy(roundedIntPoint(boxOrigin));
    11251125
    11261126    GraphicsContext* context = paintInfo.context;
    … …  
    12591259    GraphicsContextStateSaver stateSaver(*context, false);
    12601260    if (!style()->isHorizontalWritingMode()) {
    1261         marker.moveBy(-boxOrigin);
     1261        marker.moveBy(roundedIntPoint(-boxOrigin));
    12621262        marker = marker.transposedRect();
    1263         marker.move(box.x(), box.y() - logicalHeight());
     1263        marker.moveBy(IntPoint(roundToInt(box.x()), roundToInt(box.y() - logicalHeight())));
    12641264        stateSaver.save();
    12651265        context->translate(marker.x(), marker.maxY());
    … …  
    12681268    }
    12691269
    1270     LayoutPoint textOrigin = LayoutPoint(marker.x(), marker.y() + style()->fontMetrics().ascent());
     1270    IntPoint textOrigin = IntPoint(marker.x(), marker.y() + style()->fontMetrics().ascent());
    12711271
    12721272    if (type == Asterisks || type == Footnotes)
    … …  
    12871287        const UChar suffix = listMarkerSuffix(type, m_listItem->value());
    12881288        if (style()->isLeftToRightDirection()) {
    1289             LayoutUnit width = font.width(textRun);
     1289            int width = font.width(textRun);
    12901290            context->drawText(font, textRun, textOrigin);
    12911291            UChar suffixSpace[2] = { suffix, ' ' };
    … …  
    12941294            UChar spaceSuffix[2] = { ' ', suffix };
    12951295            TextRun spaceSuffixRun = RenderBlock::constructTextRun(this, font, spaceSuffix, 2, style());
    1296             LayoutUnit width = font.width(spaceSuffixRun);
     1296            int width = font.width(spaceSuffixRun);
    12971297            context->drawText(font, spaceSuffixRun, textOrigin);
    12981298            context->drawText(font, textRun, textOrigin + IntSize(width, 0));
Note: See TracChangeset for help on using the changeset viewer.