OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
6 import 'rendering/box.dart'; | 6 import 'rendering/box.dart'; |
7 import 'rendering/object.dart'; | 7 import 'rendering/object.dart'; |
8 import 'scheduler.dart' as scheduler; | 8 import 'scheduler.dart' as scheduler; |
9 | 9 |
10 class PointerState { | 10 class PointerState { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 event.dx = position.x - state.lastPosition.x; | 93 event.dx = position.x - state.lastPosition.x; |
94 event.dy = position.y - state.lastPosition.y; | 94 event.dy = position.y - state.lastPosition.y; |
95 state.lastPosition = position; | 95 state.lastPosition = position; |
96 | 96 |
97 dispatchEvent(event, state.result); | 97 dispatchEvent(event, state.result); |
98 } | 98 } |
99 | 99 |
100 void dispatchEvent(sky.Event event, HitTestResult result) { | 100 void dispatchEvent(sky.Event event, HitTestResult result) { |
101 assert(result != null); | 101 assert(result != null); |
102 for (RenderObject node in result.path.reversed) | 102 for (HitTestData data in result.path.reversed) |
103 node.handleEvent(event); | 103 data.entry.handleEvent(event, data); |
104 } | 104 } |
105 | 105 |
106 String toString() => 'Render Tree:\n${_renderView}'; | 106 String toString() => 'Render Tree:\n${_renderView}'; |
107 | 107 |
108 void debugDumpRenderTree() { | 108 void debugDumpRenderTree() { |
109 toString().split('\n').forEach(print); | 109 toString().split('\n').forEach(print); |
110 } | 110 } |
111 | 111 |
112 } | 112 } |
OLD | NEW |