Summary: | background no-repeat image wrapping when window is smaller than image | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Kirk Jackson <kirk> |
Component: | khtml renderer | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | NetBSD | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
testcase attached
Screenshot - Konqueror window that's wider than the image Screenshot - Konqueror window that's narrower than the image |
Description
Kirk Jackson
2004-08-17 07:37:28 UTC
Created attachment 8039 [details]
testcase attached
Cannot reproduce. Attach a screenshot if you still can reproduce this bug.
Created attachment 8062 [details]
Screenshot - Konqueror window that's wider than the image
Created attachment 8063 [details]
Screenshot - Konqueror window that's narrower than the image
Note that when the window is narrower than the image, the image wraps around
into the left hand margin area.
This happens with the test case already attached to this bug.
Cheers,
Kirk
This bug is not just limited to horizontally but also vertically <table cellpadding="0" cellspacing="0"> <tr> <td rowspan="3"> <img src="leftboard.jpg" height="413px" width="46px" /> </td> <td style="background-image:url(topboard.jpg); height:33px; width:488px; background-position:0px 18px; background-repeat:no-repeat"> </td> <td rowspan="3"> <img src="rightboard.jpg" height="413px" width="46px" /> </td> </tr> This is how I ran across this bug. my image is 33pixels tall. strangely tho changing the cell's height to 34 fixed it. The same problem exists in Konqueror 3.3.2. Screenshot/htmlsource available on request. SVN commit 595508 by carewolf: Add sanity to fixed background painting as well. BUG: 87336 M +10 -8 render_box.cpp --- branches/KDE/3.5/kdelibs/khtml/rendering/render_box.cpp #595507:595508 @@ -568,24 +568,26 @@ calculateBackgroundSize(bgLayer, scaledImageWidth, scaledImageHeight); EBackgroundRepeat bgr = bgLayer->backgroundRepeat(); - if( (bgr == NO_REPEAT || bgr == REPEAT_Y) && pw > scaledImageWidth ) { - cw = scaledImageWidth; - cx = vr.x() + bgLayer->backgroundXPosition().minWidth(pw - scaledImageWidth); + int xPosition = bgLayer->backgroundXPosition().minWidth(pw-scaledImageWidth); + if (bgr == NO_REPEAT || bgr == REPEAT_Y) { + cw = kMin(scaledImageWidth, pw - xPosition); + cx = vr.x() + xPosition; } else { cw = pw; cx = vr.x(); if (scaledImageWidth > 0) - sx = scaledImageWidth - bgLayer->backgroundXPosition().minWidth(pw - scaledImageWidth) % scaledImageWidth; + sx = scaledImageWidth - xPosition % scaledImageWidth; } - if( (bgr == NO_REPEAT || bgr == REPEAT_X) && ph > scaledImageHeight ) { - ch = scaledImageHeight; - cy = vr.y() + bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight); + int yPosition = bgLayer->backgroundYPosition().minWidth(ph-scaledImageHeight); + if (bgr == NO_REPEAT || bgr == REPEAT_X) { + ch = kMin(scaledImageHeight, ph - yPosition); + cy = vr.y() + yPosition; } else { ch = ph; cy = vr.y(); if (scaledImageHeight > 0) - sy = scaledImageHeight - bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight) % scaledImageHeight; + sy = scaledImageHeight - yPosition % scaledImageHeight; } QRect fix(cx, cy, cw, ch); |