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

Unified Diff: samples/dartcombat/views.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/dartcombat/views.dart
diff --git a/samples/dartcombat/views.dart b/samples/dartcombat/views.dart
index 691d34163f8f12b9389181008b9c2c7bc631dd05..f0c1d4be5fddb34565e1bb04edf17040aa1536ec 100644
--- a/samples/dartcombat/views.dart
+++ b/samples/dartcombat/views.dart
@@ -279,9 +279,9 @@ class ViewUtil {
/** Extract the position of a mouse event in a containing 500x500 grid. */
static Future<List<int>> positionFromEvent(Element gridNode, MouseEvent e) {
final completer = new Completer<List<int>>();
- gridNode.rect.then((ElementRect rect) {
- int x = (e.pageX - rect.offset.left) ~/ 50;
- int y = (e.pageY - rect.offset.top) ~/ 50;
+ window.requestLayoutFrame(() {
+ int x = (e.pageX - gridNode.offsetLeft) ~/ 50;
+ int y = (e.pageY - gridNode.offsetTop) ~/ 50;
completer.complete([x, y]);
});
return completer.future;

Powered by Google App Engine
This is Rietveld 408576698