Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: samples/tests/samples/lib/layout/grid_layout_demo.dart

Issue 11367040: Removing Element.rect. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: samples/tests/samples/lib/layout/grid_layout_demo.dart
diff --git a/samples/tests/samples/lib/layout/grid_layout_demo.dart b/samples/tests/samples/lib/layout/grid_layout_demo.dart
index 0af90b698605b7566398c27277fb8bfa6aad1570..dd42bd3dbf957eea97a296297bb904933cef07e2 100644
--- a/samples/tests/samples/lib/layout/grid_layout_demo.dart
+++ b/samples/tests/samples/lib/layout/grid_layout_demo.dart
@@ -106,15 +106,11 @@ void printMetrics(String example) {
final sb = new StringBuffer();
sb.add("test('Spec Example $exampleId', () {\n");
sb.add(" verifyExample('$example', {\n");
- final rects = new List();
final elements = node.elements;
- for (Element child in elements) {
- rects.add(child.rect);
- }
window.requestLayoutFrame(() {
for (int i = 0; i < elements.length; i++) {
- _appendMetrics(sb, elements[i], rects[i].value, ' ');
+ _appendMetrics(sb, elements[i], ' ');
}
sb.add(' });\n');
sb.add('});\n\n');
@@ -122,11 +118,10 @@ void printMetrics(String example) {
});
}
-void _appendMetrics(StringBuffer sb, Element node, ElementRect rect,
- [String indent = '']) {
+void _appendMetrics(StringBuffer sb, Element node, [String indent = '']) {
String id = node.id;
final offset = rect.offset;
- num left = offset.left, top = offset.top;
- num width = offset.width, height = offset.height;
+ num left = node.offsetLeft, top = node.offsetTop;
+ num width = node.offsetWidth, height = node.offsetHeight;
sb.add("${indent}'$id': [$left, $top, $width, $height],\n");
}

Powered by Google App Engine
This is Rietveld 408576698