Changeset 26591 in webkit


Ignore:
Timestamp:
Oct 14, 2007 4:59:35 AM (17 years ago)
Author:
bdash
Message:

2007-10-14 Peter Kasting <zerodpx@gmail.com>

Reviewed by Maciej.

http://bugs.webkit.org/show_bug.cgi?id=15210
Draw the image outline even for broken images.

  • rendering/RenderImage.cpp: (WebCore::RenderImage::paint):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r26589 r26591  
     12007-10-14  Peter Kasting  <zerodpx@gmail.com>
     2
     3        Reviewed by Maciej.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=15210
     6        Draw the image outline even for broken images.
     7
     8        * rendering/RenderImage.cpp:
     9        (WebCore::RenderImage::paint):
     10
    1112007-10-14  Kevin Ollivier  <kevino@theolliviers.com>
    212
  • trunk/WebCore/rendering/RenderImage.cpp

    r26534 r26591  
    224224
    225225        if (cWidth > 2 && cHeight > 2) {
    226             if (!errorOccurred()) {
    227                 context->setStrokeStyle(SolidStroke);
    228                 context->setStrokeColor(Color::lightGray);
    229                 context->setFillColor(Color::transparent);
    230                 context->drawRect(IntRect(tx + leftBorder + leftPad, ty + topBorder + topPad, cWidth, cHeight));
    231             }
     226            // Draw an outline rect where the image should be.
     227            context->setStrokeStyle(SolidStroke);
     228            context->setStrokeColor(Color::lightGray);
     229            context->setFillColor(Color::transparent);
     230            context->drawRect(IntRect(tx + leftBorder + leftPad, ty + topBorder + topPad, cWidth, cHeight));
    232231
    233232            bool errorPictureDrawn = false;
    234233            int imageX = 0;
    235234            int imageY = 0;
    236             int usableWidth = cWidth;
    237             int usableHeight = cHeight;
     235            // When calculating the usable dimensions, exclude the pixels of
     236            // the ouline rect so the error image/alt text doesn't draw on it.
     237            int usableWidth = cWidth - 2;
     238            int usableHeight = cHeight - 2;
    238239
    239240            if (errorOccurred() && !image()->isNull() && (usableWidth >= image()->width()) && (usableHeight >= image()->height())) {
Note: See TracChangeset for help on using the changeset viewer.