Index: Source/core/platform/ScrollableArea.cpp |
diff --git a/Source/core/platform/ScrollableArea.cpp b/Source/core/platform/ScrollableArea.cpp |
index 0f02cf04bc2b3ff3a325ea00e11de5e29b5a5752..e9b61b322938f98a72470364ee7ed115be568800 100644 |
--- a/Source/core/platform/ScrollableArea.cpp |
+++ b/Source/core/platform/ScrollableArea.cpp |
@@ -82,6 +82,21 @@ void ScrollableArea::setScrollOrigin(const IntPoint& origin) |
} |
} |
+bool ScrollableArea::touchScroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier) |
Rick Byers
2013/05/30 16:15:00
Adding a new method for this feels wrong to me (as
Rick Byers
2013/05/30 16:15:00
This is called 'touchScroll' but there's nothing i
bokan
2013/05/30 18:23:51
That's what I tried at first, but that breaks non-
|
+{ |
+ // For a touch scroll, we don't need the scrollbars to exist (i.e. for an input text field) |
+ ScrollbarOrientation orientation; |
+ if (direction == ScrollUp || direction == ScrollDown) |
+ orientation = VerticalScrollbar; |
+ else |
+ orientation = HorizontalScrollbar; |
+ |
+ if (direction == ScrollUp || direction == ScrollLeft) |
+ multiplier = -multiplier; |
+ |
+ return scrollAnimator()->scroll(orientation, granularity, 1.0f, multiplier); |
Rick Byers
2013/05/30 16:15:00
Is treating all values of 'granularity' really ok?
bokan
2013/05/30 18:23:51
In theory, it looks like a wheel could send a non-
|
+} |
+ |
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier) |
{ |
ScrollbarOrientation orientation; |