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

Side by Side Diff: samples/swarm/swarm_ui_lib/touch/Scroller.dart

Issue 12605003: Converting Element.client*, offset* and Screen.avail* over to Rects (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of touch; 5 part of touch;
6 6
7 /** 7 /**
8 * Implementation of a custom scrolling behavior. 8 * Implementation of a custom scrolling behavior.
9 * This behavior overrides native scrolling for an area. This area can be a 9 * This behavior overrides native scrolling for an area. This area can be a
10 * single defined part of a page, the entire page, or several different parts 10 * single defined part of a page, the entire page, or several different parts
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 * and maxPoint allowed for scrolling. 553 * and maxPoint allowed for scrolling.
554 */ 554 */
555 void _resize(Callback callback) { 555 void _resize(Callback callback) {
556 window.setImmediate(() { 556 window.setImmediate(() {
557 if (_lookupContentSizeDelegate != null) { 557 if (_lookupContentSizeDelegate != null) {
558 _contentSize = _lookupContentSizeDelegate(); 558 _contentSize = _lookupContentSizeDelegate();
559 } else { 559 } else {
560 _contentSize = new Size(_element.scrollWidth, _element.scrollHeight); 560 _contentSize = new Size(_element.scrollWidth, _element.scrollHeight);
561 } 561 }
562 562
563 _scrollSize = new Size(_frame.offsetWidth, 563 _scrollSize = new Size(_frame.offset.width,
564 _frame.offsetHeight); 564 _frame.offset.height);
565 Size adjusted = _getAdjustedContentSize(); 565 Size adjusted = _getAdjustedContentSize();
566 _maxPoint = new Coordinate(-_maxOffset.x, -_maxOffset.y); 566 _maxPoint = new Coordinate(-_maxOffset.x, -_maxOffset.y);
567 _minPoint = new Coordinate( 567 _minPoint = new Coordinate(
568 Math.min( 568 Math.min(
569 _scrollSize.width - adjusted.width + _minOffset.x, _maxPoint.x), 569 _scrollSize.width - adjusted.width + _minOffset.x, _maxPoint.x),
570 Math.min( 570 Math.min(
571 _scrollSize.height - adjusted.height + _minOffset.y, _maxPoint.y)) ; 571 _scrollSize.height - adjusted.height + _minOffset.y, _maxPoint.y)) ;
572 callback(); 572 callback();
573 }); 573 });
574 } 574 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 static const SCROLLER_END = "scroller:scroll_end"; 684 static const SCROLLER_END = "scroller:scroll_end";
685 static const DRAG_END = "scroller:drag_end"; 685 static const DRAG_END = "scroller:drag_end";
686 static const CONTENT_MOVED = "scroller:content_moved"; 686 static const CONTENT_MOVED = "scroller:content_moved";
687 static const DECEL_START = "scroller:decel_start"; 687 static const DECEL_START = "scroller:decel_start";
688 } 688 }
689 689
690 class ScrollerScrollTechnique { 690 class ScrollerScrollTechnique {
691 static const TRANSFORM_3D = 1; 691 static const TRANSFORM_3D = 1;
692 static const RELATIVE_POSITIONING = 2; 692 static const RELATIVE_POSITIONING = 2;
693 } 693 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/layout/ViewLayout.dart ('k') | samples/swarm/swarm_ui_lib/view/PagedViews.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698