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

Unified Diff: samples/ui_lib/touch/Scroller.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/touch/Scroller.dart
diff --git a/samples/ui_lib/touch/Scroller.dart b/samples/ui_lib/touch/Scroller.dart
index 401b807067c11b73693efb362ecace2de442ab99..df049a27dac8374e08107829c6999870ef0eb6e7 100644
--- a/samples/ui_lib/touch/Scroller.dart
+++ b/samples/ui_lib/touch/Scroller.dart
@@ -541,24 +541,15 @@ class Scroller implements Draggable, MomentumDelegate {
* and maxPoint allowed for scrolling.
*/
void _resize(Callback callback) {
- final frameRect = _frame.rect;
- Future contentSizeFuture;
-
- if (_lookupContentSizeDelegate !== null) {
- contentSizeFuture = _lookupContentSizeDelegate();
- contentSizeFuture.then((Size size) {
- _contentSize = size;
- });
- } else {
- contentSizeFuture = _element.rect;
- contentSizeFuture.then((ElementRect rect) {
- _contentSize = new Size(rect.scroll.width, rect.scroll.height);
- });
- }
+ window.requestLayoutFrame(() {
+ if (_lookupContentSizeDelegate !== null) {
+ _contentSize = _lookupContentSizeDelegate();
+ } else {
+ _contentSize = new Size(_element.scrollWidth, _element.scrollHeight);
+ }
- joinFutures(<Future>[frameRect, contentSizeFuture], () {
- _scrollSize = new Size(frameRect.value.offset.width,
- frameRect.value.offset.height);
+ _scrollSize = new Size(_frame.offsetWidth,
+ _frame.offsetHeight);
Size adjusted = _getAdjustedContentSize();
_maxPoint = new Coordinate(-_maxOffset.x, -_maxOffset.y);
_minPoint = new Coordinate(

Powered by Google App Engine
This is Rietveld 408576698