OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 else | 294 else |
295 return false; | 295 return false; |
296 | 296 |
297 return true; | 297 return true; |
298 } | 298 } |
299 | 299 |
300 ScrollResult ScrollableArea::handleWheel(const PlatformWheelEvent& wheelEvent) | 300 ScrollResult ScrollableArea::handleWheel(const PlatformWheelEvent& wheelEvent) |
301 { | 301 { |
302 // Wheel events which do not scroll are used to trigger zooming. | 302 // Wheel events which do not scroll are used to trigger zooming. |
303 if (!wheelEvent.canScroll()) | 303 if (!wheelEvent.canScroll()) |
304 return ScrollResult(); | 304 return ScrollResult(false, false, wheelEvent.deltaX(), wheelEvent.deltaY ()); |
bokan
2015/06/23 16:20:45
Doesn't this mean that a browser zoom (ctrl + whee
MuVen
2015/06/25 12:55:51
Done. True, i checked it, it wont trigger overscro
| |
305 | 305 |
306 cancelProgrammaticScrollAnimation(); | 306 cancelProgrammaticScrollAnimation(); |
307 return scrollAnimator()->handleWheelEvent(wheelEvent); | 307 return scrollAnimator()->handleWheelEvent(wheelEvent); |
308 } | 308 } |
309 | 309 |
310 IntPoint ScrollableArea::adjustScrollPositionWithinRange(const IntPoint& scrollP oint) const | 310 IntPoint ScrollableArea::adjustScrollPositionWithinRange(const IntPoint& scrollP oint) const |
311 { | 311 { |
312 if (!constrainsScrollingToContentEdge()) | 312 if (!constrainsScrollingToContentEdge()) |
313 return scrollPoint; | 313 return scrollPoint; |
314 | 314 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
622 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; | 622 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; |
623 if (Scrollbar* horizontalBar = horizontalScrollbar()) | 623 if (Scrollbar* horizontalBar = horizontalScrollbar()) |
624 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; | 624 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; |
625 | 625 |
626 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), | 626 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), |
627 std::max(0, size.height() - horizontalScrollbarHeight)); | 627 std::max(0, size.height() - horizontalScrollbarHeight)); |
628 | 628 |
629 } | 629 } |
630 | 630 |
631 } // namespace blink | 631 } // namespace blink |
OLD | NEW |