diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/rendering/RenderScrollbar.cpp | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/rendering/RenderScrollbar.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderScrollbar.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/Source/WebCore/rendering/RenderScrollbar.cpp b/Source/WebCore/rendering/RenderScrollbar.cpp index 6f6fd53ea..0c50c0d39 100644 --- a/Source/WebCore/rendering/RenderScrollbar.cpp +++ b/Source/WebCore/rendering/RenderScrollbar.cpp @@ -297,27 +297,26 @@ IntRect RenderScrollbar::buttonRect(ScrollbarPart partType) bool isHorizontal = orientation() == HorizontalScrollbar; if (partType == BackButtonStartPart) - return IntRect(location(), IntSize(isHorizontal ? partRenderer->width() : width(), isHorizontal ? height() : partRenderer->height())); + return IntRect(location(), IntSize(isHorizontal ? partRenderer->pixelSnappedWidth() : width(), isHorizontal ? height() : partRenderer->pixelSnappedHeight())); if (partType == ForwardButtonEndPart) - return IntRect(isHorizontal ? x() + width() - partRenderer->width() : x(), - - isHorizontal ? y() : y() + height() - partRenderer->height(), - isHorizontal ? partRenderer->width() : width(), - isHorizontal ? height() : partRenderer->height()); + return IntRect(isHorizontal ? x() + width() - partRenderer->pixelSnappedWidth() : x(), + isHorizontal ? y() : y() + height() - partRenderer->pixelSnappedHeight(), + isHorizontal ? partRenderer->pixelSnappedWidth() : width(), + isHorizontal ? height() : partRenderer->pixelSnappedHeight()); if (partType == ForwardButtonStartPart) { IntRect previousButton = buttonRect(BackButtonStartPart); return IntRect(isHorizontal ? x() + previousButton.width() : x(), isHorizontal ? y() : y() + previousButton.height(), - isHorizontal ? partRenderer->width() : width(), - isHorizontal ? height() : partRenderer->height()); + isHorizontal ? partRenderer->pixelSnappedWidth() : width(), + isHorizontal ? height() : partRenderer->pixelSnappedHeight()); } IntRect followingButton = buttonRect(ForwardButtonEndPart); - return IntRect(isHorizontal ? x() + width() - followingButton.width() - partRenderer->width() : x(), - isHorizontal ? y() : y() + height() - followingButton.height() - partRenderer->height(), - isHorizontal ? partRenderer->width() : width(), - isHorizontal ? height() : partRenderer->height()); + return IntRect(isHorizontal ? x() + width() - followingButton.width() - partRenderer->pixelSnappedWidth() : x(), + isHorizontal ? y() : y() + height() - followingButton.height() - partRenderer->pixelSnappedHeight(), + isHorizontal ? partRenderer->pixelSnappedWidth() : width(), + isHorizontal ? height() : partRenderer->pixelSnappedHeight()); } IntRect RenderScrollbar::trackRect(int startLength, int endLength) @@ -327,16 +326,16 @@ IntRect RenderScrollbar::trackRect(int startLength, int endLength) part->layout(); if (orientation() == HorizontalScrollbar) { - int marginLeft = part ? part->marginLeft() : 0; - int marginRight = part ? part->marginRight() : 0; + int marginLeft = part ? static_cast<int>(part->marginLeft()) : 0; + int marginRight = part ? static_cast<int>(part->marginRight()) : 0; startLength += marginLeft; endLength += marginRight; int totalLength = startLength + endLength; return IntRect(x() + startLength, y(), width() - totalLength, height()); } - int marginTop = part ? part->marginTop() : 0; - int marginBottom = part ? part->marginBottom() : 0; + int marginTop = part ? static_cast<int>(part->marginTop()) : 0; + int marginBottom = part ? static_cast<int>(part->marginBottom()) : 0; startLength += marginTop; endLength += marginBottom; int totalLength = startLength + endLength; |