| 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 '../node.dart'; | 5 import '../node.dart'; |
| 6 import '../scheduler.dart' as scheduler; | 6 import '../scheduler.dart' as scheduler; |
| 7 import 'dart:math' as math; | 7 import 'dart:math' as math; |
| 8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
| 9 | 9 |
| 10 class ParentData { | 10 class ParentData { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // // For each child that intersects x,y, in z-order starting from the top, | 215 // // For each child that intersects x,y, in z-order starting from the top, |
| 216 // // call hitTest() for that child, passing it /result/, and the coordinate
s | 216 // // call hitTest() for that child, passing it /result/, and the coordinate
s |
| 217 // // converted to the child's coordinate origin, and stop at the first chil
d | 217 // // converted to the child's coordinate origin, and stop at the first chil
d |
| 218 // // that returns true. | 218 // // that returns true. |
| 219 // // Then, add yourself to /result/, and return true. | 219 // // Then, add yourself to /result/, and return true. |
| 220 // } | 220 // } |
| 221 // You must not add yourself to /result/ if you return false. | 221 // You must not add yourself to /result/ if you return false. |
| 222 | 222 |
| 223 | 223 |
| 224 String toString([String prefix = '']) { | 224 String toString([String prefix = '']) { |
| 225 String header = '${runtimeType}\n'; | 225 String header = '${runtimeType}'; |
| 226 if (_relayoutSubtreeRoot != null && _relayoutSubtreeRoot != this) { |
| 227 int count = 1; |
| 228 RenderObject target = parent; |
| 229 while (target != null && target != _relayoutSubtreeRoot) { |
| 230 target = target.parent as RenderObject; |
| 231 count += 1; |
| 232 } |
| 233 header += ' relayoutSubtreeRoot=up$count'; |
| 234 } |
| 235 if (_needsLayout) |
| 236 header += ' NEEDS-LAYOUT'; |
| 237 if (!attached) |
| 238 header += ' DETACHED'; |
| 226 prefix += ' '; | 239 prefix += ' '; |
| 227 return '${header}${debugDescribeSettings(prefix)}${debugDescribeChildren(pre
fix)}'; | 240 return '${header}\n${debugDescribeSettings(prefix)}${debugDescribeChildren(p
refix)}'; |
| 228 } | 241 } |
| 229 String debugDescribeSettings(String prefix) => '${prefix}parentData: ${parentD
ata}\n'; | 242 String debugDescribeSettings(String prefix) => '${prefix}parentData: ${parentD
ata}\n'; |
| 230 String debugDescribeChildren(String prefix) => ''; | 243 String debugDescribeChildren(String prefix) => ''; |
| 231 | 244 |
| 232 } | 245 } |
| 233 | 246 |
| 234 class HitTestResult { | 247 class HitTestResult { |
| 235 final List<RenderObject> path = new List<RenderObject>(); | 248 final List<RenderObject> path = new List<RenderObject>(); |
| 236 | 249 |
| 237 RenderObject get result => path.first; | 250 RenderObject get result => path.first; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 int count = 1; | 435 int count = 1; |
| 423 ChildType child = _firstChild; | 436 ChildType child = _firstChild; |
| 424 while (child != null) { | 437 while (child != null) { |
| 425 result += '${prefix}child ${count}: ${child.toString(prefix)}'; | 438 result += '${prefix}child ${count}: ${child.toString(prefix)}'; |
| 426 count += 1; | 439 count += 1; |
| 427 child = child.parentData.nextSibling; | 440 child = child.parentData.nextSibling; |
| 428 } | 441 } |
| 429 return result; | 442 return result; |
| 430 } | 443 } |
| 431 } | 444 } |
| OLD | NEW |