OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar(); | 84 Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar(); |
85 Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar(); | 85 Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar(); |
86 | 86 |
87 // Accept the event if we have a scrollbar in that direction and can still | 87 // Accept the event if we have a scrollbar in that direction and can still |
88 // scroll any further. | 88 // scroll any further. |
89 float deltaX = horizontalScrollbar ? e.deltaX() : 0; | 89 float deltaX = horizontalScrollbar ? e.deltaX() : 0; |
90 float deltaY = verticalScrollbar ? e.deltaY() : 0; | 90 float deltaY = verticalScrollbar ? e.deltaY() : 0; |
91 | 91 |
92 bool handled = false; | 92 bool handled = false; |
93 | 93 |
94 #if PLATFORM(CHROMIUM) | 94 #if PLATFORM(CHROMIUM) && !OS(DARWIN) |
95 ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrec
isePixel : ScrollByPixel; | 95 ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrec
isePixel : ScrollByPixel; |
96 #else | 96 #else |
97 ScrollGranularity granularity = ScrollByPixel; | 97 ScrollGranularity granularity = ScrollByPixel; |
98 #endif | 98 #endif |
99 | 99 |
100 IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() -
m_scrollableArea->scrollPosition(); | 100 IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() -
m_scrollableArea->scrollPosition(); |
101 IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scro
llableArea->minimumScrollPosition(); | 101 IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scro
llableArea->minimumScrollPosition(); |
102 if ((deltaX < 0 && maxForwardScrollDelta.width() > 0) | 102 if ((deltaX < 0 && maxForwardScrollDelta.width() > 0) |
103 || (deltaX > 0 && maxBackwardScrollDelta.width() > 0) | 103 || (deltaX > 0 && maxBackwardScrollDelta.width() > 0) |
104 || (deltaY < 0 && maxForwardScrollDelta.height() > 0) | 104 || (deltaY < 0 && maxForwardScrollDelta.height() > 0) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 { | 143 { |
144 return FloatPoint(m_currentPosX, m_currentPosY); | 144 return FloatPoint(m_currentPosX, m_currentPosY); |
145 } | 145 } |
146 | 146 |
147 void ScrollAnimator::notifyPositionChanged() | 147 void ScrollAnimator::notifyPositionChanged() |
148 { | 148 { |
149 m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_cur
rentPosY)); | 149 m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_cur
rentPosY)); |
150 } | 150 } |
151 | 151 |
152 } // namespace WebCore | 152 } // namespace WebCore |
OLD | NEW |