OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 { | 443 { |
444 FrameView* view = mainFrame()->view(); | 444 FrameView* view = mainFrame()->view(); |
445 ScrollResult viewScrollResult = view->wheelEvent(event); | 445 ScrollResult viewScrollResult = view->wheelEvent(event); |
446 | 446 |
447 // The virtual viewport will only accept pixel scrolls. | 447 // The virtual viewport will only accept pixel scrolls. |
448 if (!event.canScroll() || event.granularity() == ScrollByPageWheelEvent) | 448 if (!event.canScroll() || event.granularity() == ScrollByPageWheelEvent) |
449 return viewScrollResult; | 449 return viewScrollResult; |
450 | 450 |
451 // Move the location by the negative of the remaining scroll delta. | 451 // Move the location by the negative of the remaining scroll delta. |
452 FloatPoint oldOffset = m_offset; | 452 FloatPoint oldOffset = m_offset; |
453 FloatPoint locationDelta = viewScrollResult.didScroll ? | 453 FloatPoint locationDelta; |
454 -FloatPoint(viewScrollResult.unusedScrollDeltaX, viewScrollResult.unused
ScrollDeltaY) : | 454 if (viewScrollResult.didScroll) { |
455 -FloatPoint(event.deltaX(), event.deltaY()); | 455 locationDelta = -FloatPoint(viewScrollResult.unusedScrollDeltaX, viewScr
ollResult.unusedScrollDeltaY); |
| 456 } else { |
| 457 if (event.railsMode() != PlatformEvent::RailsModeVertical) |
| 458 locationDelta.setX(-event.deltaX()); |
| 459 if (event.railsMode() != PlatformEvent::RailsModeHorizontal) |
| 460 locationDelta.setY(-event.deltaY()); |
| 461 } |
456 move(locationDelta); | 462 move(locationDelta); |
457 | 463 |
458 FloatPoint usedLocationDelta(m_offset - oldOffset); | 464 FloatPoint usedLocationDelta(m_offset - oldOffset); |
459 if (!viewScrollResult.didScroll && usedLocationDelta == FloatPoint::zero()) | 465 if (!viewScrollResult.didScroll && usedLocationDelta == FloatPoint::zero()) |
460 return ScrollResult(false); | 466 return ScrollResult(false); |
461 | 467 |
462 FloatPoint unusedLocationDelta(locationDelta - usedLocationDelta); | 468 FloatPoint unusedLocationDelta(locationDelta - usedLocationDelta); |
463 return ScrollResult(true, -unusedLocationDelta.x(), -unusedLocationDelta.y()
); | 469 return ScrollResult(true, -unusedLocationDelta.x(), -unusedLocationDelta.y()
); |
464 } | 470 } |
465 | 471 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 } else if (graphicsLayer == m_rootTransformLayer) { | 639 } else if (graphicsLayer == m_rootTransformLayer) { |
634 name = "Root Transform Layer"; | 640 name = "Root Transform Layer"; |
635 } else { | 641 } else { |
636 ASSERT_NOT_REACHED(); | 642 ASSERT_NOT_REACHED(); |
637 } | 643 } |
638 | 644 |
639 return name; | 645 return name; |
640 } | 646 } |
641 | 647 |
642 } // namespace blink | 648 } // namespace blink |
OLD | NEW |