| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006-2009 Google Inc. | 3 * Copyright (C) 2006-2009 Google Inc. |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 case NSRightMouseDragged: | 960 case NSRightMouseDragged: |
| 961 result.type = WebInputEvent::MouseMove; | 961 result.type = WebInputEvent::MouseMove; |
| 962 result.button = WebMouseEvent::ButtonRight; | 962 result.button = WebMouseEvent::ButtonRight; |
| 963 break; | 963 break; |
| 964 default: | 964 default: |
| 965 ASSERT_NOT_REACHED(); | 965 ASSERT_NOT_REACHED(); |
| 966 } | 966 } |
| 967 | 967 |
| 968 NSPoint location = [NSEvent mouseLocation]; // global coordinates | 968 NSPoint location = [NSEvent mouseLocation]; // global coordinates |
| 969 result.globalX = location.x; | 969 result.globalX = location.x; |
| 970 result.globalY = location.y; | 970 result.globalY = [[[view window] screen] frame].size.height - location.y; |
| 971 | 971 |
| 972 NSPoint windowLocal = [event locationInWindow]; | 972 NSPoint windowLocal = [event locationInWindow]; |
| 973 location = [view convertPoint:windowLocal fromView:nil]; | 973 location = [view convertPoint:windowLocal fromView:nil]; |
| 974 result.y = [view frame].size.height - location.y; // flip y | 974 result.y = [view frame].size.height - location.y; // flip y |
| 975 result.x = location.x; | 975 result.x = location.x; |
| 976 result.windowX = result.x; | 976 result.windowX = result.x; |
| 977 result.windowY = result.y; | 977 result.windowY = result.y; |
| 978 | 978 |
| 979 result.modifiers = modifiersFromEvent(event); | 979 result.modifiers = modifiersFromEvent(event); |
| 980 | 980 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 result.deltaX = [event deltaX] * scrollbarPixelsPerCocoaTick; | 1131 result.deltaX = [event deltaX] * scrollbarPixelsPerCocoaTick; |
| 1132 result.deltaY = [event deltaY] * scrollbarPixelsPerCocoaTick; | 1132 result.deltaY = [event deltaY] * scrollbarPixelsPerCocoaTick; |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 result.timeStampSeconds = [event timestamp]; | 1135 result.timeStampSeconds = [event timestamp]; |
| 1136 | 1136 |
| 1137 return result; | 1137 return result; |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 } // namespace WebKit | 1140 } // namespace WebKit |
| OLD | NEW |