| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 static FloatSize scaleSizeToWindow(const Widget* widget, FloatSize size) | 64 static FloatSize scaleSizeToWindow(const Widget* widget, FloatSize size) |
| 65 { | 65 { |
| 66 return FloatSize(scaleDeltaToWindow(widget, size.width()), scaleDeltaToWindo
w(widget, size.height())); | 66 return FloatSize(scaleDeltaToWindow(widget, size.width()), scaleDeltaToWindo
w(widget, size.height())); |
| 67 } | 67 } |
| 68 | 68 |
| 69 static FloatPoint convertHitPointToWindow(const Widget* widget, FloatPoint point
) | 69 static FloatPoint convertHitPointToWindow(const Widget* widget, FloatPoint point
) |
| 70 { | 70 { |
| 71 float scale = 1; | 71 float scale = 1; |
| 72 IntSize offset; | 72 IntSize offset; |
| 73 IntPoint pinchViewport; | 73 IntPoint pinchViewport; |
| 74 FloatSize overscrollOffset; |
| 74 if (widget) { | 75 if (widget) { |
| 75 FrameView* rootView = toFrameView(widget->root()); | 76 FrameView* rootView = toFrameView(widget->root()); |
| 76 if (rootView) { | 77 if (rootView) { |
| 77 scale = rootView->inputEventsScaleFactor(); | 78 scale = rootView->inputEventsScaleFactor(); |
| 78 offset = rootView->inputEventsOffsetForEmulation(); | 79 offset = rootView->inputEventsOffsetForEmulation(); |
| 79 pinchViewport = flooredIntPoint(rootView->page()->frameHost().pinchV
iewport().visibleRect().location()); | 80 pinchViewport = flooredIntPoint(rootView->page()->frameHost().pinchV
iewport().visibleRect().location()); |
| 81 overscrollOffset = rootView->elasticOverscroll(); |
| 80 } | 82 } |
| 81 } | 83 } |
| 82 return FloatPoint( | 84 return FloatPoint( |
| 83 (point.x() - offset.width()) / scale + pinchViewport.x(), | 85 (point.x() - offset.width()) / scale + pinchViewport.x() + overscrollOff
set.width(), |
| 84 (point.y() - offset.height()) / scale + pinchViewport.y()); | 86 (point.y() - offset.height()) / scale + pinchViewport.y() + overscrollOf
fset.height()); |
| 85 } | 87 } |
| 86 | 88 |
| 87 static int toWebEventModifiers(unsigned platformModifiers) | 89 static int toWebEventModifiers(unsigned platformModifiers) |
| 88 { | 90 { |
| 89 int newModifiers = 0; | 91 int newModifiers = 0; |
| 90 if (platformModifiers & PlatformEvent::ShiftKey) | 92 if (platformModifiers & PlatformEvent::ShiftKey) |
| 91 newModifiers |= WebInputEvent::ShiftKey; | 93 newModifiers |= WebInputEvent::ShiftKey; |
| 92 if (platformModifiers & PlatformEvent::CtrlKey) | 94 if (platformModifiers & PlatformEvent::CtrlKey) |
| 93 newModifiers |= WebInputEvent::ControlKey; | 95 newModifiers |= WebInputEvent::ControlKey; |
| 94 if (platformModifiers & PlatformEvent::AltKey) | 96 if (platformModifiers & PlatformEvent::AltKey) |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 modifiers = getWebInputModifiers(event); | 804 modifiers = getWebInputModifiers(event); |
| 803 | 805 |
| 804 globalX = event.screenX(); | 806 globalX = event.screenX(); |
| 805 globalY = event.screenY(); | 807 globalY = event.screenY(); |
| 806 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); | 808 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); |
| 807 x = localPoint.x(); | 809 x = localPoint.x(); |
| 808 y = localPoint.y(); | 810 y = localPoint.y(); |
| 809 } | 811 } |
| 810 | 812 |
| 811 } // namespace blink | 813 } // namespace blink |
| OLD | NEW |