Created
November 17, 2011 13:33
-
-
Save zenoalbisser/1373140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp | |
index 9faef61..ce3d1ef 100644 | |
--- a/Source/WebCore/platform/ScrollView.cpp | |
+++ b/Source/WebCore/platform/ScrollView.cpp | |
@@ -713,11 +713,17 @@ IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const | |
IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const | |
{ | |
IntPoint viewPoint = convertFromContainingWindow(windowPoint); | |
+ if (delegatesScrolling()) | |
+ return viewPoint; | |
+ | |
return viewPoint + scrollOffset(); | |
} | |
IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const | |
{ | |
+ if (delegatesScrolling()) | |
+ return convertToContainingWindow(contentsPoint); | |
+ | |
IntPoint viewPoint = contentsPoint - scrollOffset(); | |
return convertToContainingWindow(viewPoint); | |
} | |
@@ -725,12 +731,18 @@ IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const | |
IntRect ScrollView::windowToContents(const IntRect& windowRect) const | |
{ | |
IntRect viewRect = convertFromContainingWindow(windowRect); | |
+ if (delegatesScrolling()) | |
+ return viewRect; | |
+ | |
viewRect.move(scrollOffset()); | |
return viewRect; | |
} | |
IntRect ScrollView::contentsToWindow(const IntRect& contentsRect) const | |
{ | |
+ if (delegatesScrolling()) | |
+ return convertToContainingWindow(contentsRect); | |
+ | |
IntRect viewRect = contentsRect; | |
viewRect.move(-scrollOffset()); | |
return convertToContainingWindow(viewRect); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment