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

Unified Diff: samples/ui_lib/view/SliderMenu.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/ui_lib/view/SliderMenu.dart
diff --git a/samples/ui_lib/view/SliderMenu.dart b/samples/ui_lib/view/SliderMenu.dart
index 16a5b1aca556a3c6562dffba67c5cb2fe0f46e59..db7a1f052674862cbb86f3f425450265da95d211 100644
--- a/samples/ui_lib/view/SliderMenu.dart
+++ b/samples/ui_lib/view/SliderMenu.dart
@@ -155,9 +155,9 @@ class SliderMenu extends View {
void updateIndicator(bool animate) {
if (selectedItem != null) {
// calculate where we want to put the triangle
- selectedItem.rect.then((ElementRect rect) {
- num x = rect.offset.left +
- rect.offset.width / 2 - TRIANGLE_WIDTH / 2;
+ window.requestLayoutFrame(() {
+ num x = selectedItem.offsetLeft +
+ selectedItem.offsetWidth / 2 - TRIANGLE_WIDTH / 2;
_moveIndicator(x, animate);
});
} else {

Powered by Google App Engine
This is Rietveld 408576698