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

Side by Side Diff: client/touch/TouchHandler.dart

Issue 8422005: Remove List.fromList constructor, and List.copyFrom. They are duplicates of the new range methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | compiler/lib/implementation/array.dart » ('j') | runtime/lib/array.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * Touch Handler. Class that handles all touch events and 6 * Touch Handler. Class that handles all touch events and
7 * uses them to interpret higher level gestures and behaviors. TouchEvent is a 7 * uses them to interpret higher level gestures and behaviors. TouchEvent is a
8 * built in mobile safari type: 8 * built in mobile safari type:
9 * [http://developer.apple.com/safari/library/documentation/UserExperience/Refer ence/TouchEventClassReference/TouchEvent/TouchEvent.html]. 9 * [http://developer.apple.com/safari/library/documentation/UserExperience/Refer ence/TouchEventClassReference/TouchEvent/TouchEvent.html].
10 * 10 *
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 assert (len % 2 == 0); 342 assert (len % 2 == 0);
343 while (count < len && 343 while (count < len &&
344 recentTime - recentTouches[count + 1] > _MAX_TRACKING_TIME || 344 recentTime - recentTouches[count + 1] > _MAX_TRACKING_TIME ||
345 (len - count) > _MAX_TRACKING_TOUCHES * 2) { 345 (len - count) > _MAX_TRACKING_TOUCHES * 2) {
346 count += 2; 346 count += 2;
347 } 347 }
348 return count == 0 ? recentTouches : _removeFirstN(recentTouches, count); 348 return count == 0 ? recentTouches : _removeFirstN(recentTouches, count);
349 } 349 }
350 350
351 static List<int> _removeFirstN(List<int> list, int n) { 351 static List<int> _removeFirstN(List<int> list, int n) {
352 return new List<int>.fromList(list, n, list.length); 352 return list.getRange(n, list.length - n);
353 } 353 }
354 354
355 /** 355 /**
356 * Filters the provided recent touches list to remove all touches except the 356 * Filters the provided recent touches list to remove all touches except the
357 * last if the move direction has changed. 357 * last if the move direction has changed.
358 * [recentTouches] specifies a list of tuples where the first item is the x 358 * [recentTouches] specifies a list of tuples where the first item is the x
359 * or y component of the recent touch and the second item is the touch time 359 * or y component of the recent touch and the second item is the touch time
360 * stamp. The x or y component of the most recent move is specified by 360 * stamp. The x or y component of the most recent move is specified by
361 * [recentMove]. 361 * [recentMove].
362 */ 362 */
(...skipping 21 matching lines...) Expand all
384 384
385 /** 385 /**
386 * Call this method to enable drag behavior on a draggable delegate. 386 * Call this method to enable drag behavior on a draggable delegate.
387 * The [draggable] object can be the same as the [_touchable] object, they are 387 * The [draggable] object can be the same as the [_touchable] object, they are
388 * assigned to different members to allow for strong typing with interfaces. 388 * assigned to different members to allow for strong typing with interfaces.
389 */ 389 */
390 void setDraggable(Draggable draggable) { 390 void setDraggable(Draggable draggable) {
391 _draggable = draggable; 391 _draggable = draggable;
392 } 392 }
393 } 393 }
OLDNEW
« no previous file with comments | « no previous file | compiler/lib/implementation/array.dart » ('j') | runtime/lib/array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698