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( |