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

Side by Side Diff: tools/dom/templates/html/impl/impl_ClientRect.darttemplate

Issue 2211563002: Use Point<num> in dart:html for strong mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 @DocsEditable() 7 @DocsEditable()
8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements Rectangle$IMPLEMENTS { 8 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements Rectangle$IMPLEMENTS {
9 9
10 // NOTE! All code below should be common with RectangleBase. 10 // NOTE! All code below should be common with RectangleBase.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 /** 82 /**
83 * Tests whether [another] is inside or along the edges of `this`. 83 * Tests whether [another] is inside or along the edges of `this`.
84 */ 84 */
85 bool containsPoint(Point<num> another) { 85 bool containsPoint(Point<num> another) {
86 return another.x >= left && 86 return another.x >= left &&
87 another.x <= left + width && 87 another.x <= left + width &&
88 another.y >= top && 88 another.y >= top &&
89 another.y <= top + height; 89 another.y <= top + height;
90 } 90 }
91 91
92 Point get topLeft => new Point(this.left, this.top); 92 Point get topLeft => new Point/*<num>*/(this.left, this.top);
93 Point get topRight => new Point(this.left + this.width, this.top); 93 Point get topRight => new Point/*<num>*/(this.left + this.width, this.top);
94 Point get bottomRight => new Point(this.left + this.width, 94 Point get bottomRight => new Point/*<num>*/(this.left + this.width,
95 this.top + this.height); 95 this.top + this.height);
96 Point get bottomLeft => new Point(this.left, 96 Point get bottomLeft => new Point/*<num>*/(this.left,
97 this.top + this.height); 97 this.top + this.height);
98 98
99 $!MEMBERS} 99 $!MEMBERS}
100 100
101 /** 101 /**
102 * This is the [Jenkins hash function][1] but using masking to keep 102 * This is the [Jenkins hash function][1] but using masking to keep
103 * values in SMI range. 103 * values in SMI range.
104 * 104 *
105 * [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function 105 * [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
106 * 106 *
(...skipping 20 matching lines...) Expand all
127 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); 127 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
128 hash = hash ^ (hash >> 11); 128 hash = hash ^ (hash >> 11);
129 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); 129 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
130 } 130 }
131 131
132 static int hash2(a, b) => finish(combine(combine(0, a), b)); 132 static int hash2(a, b) => finish(combine(combine(0, a), b));
133 133
134 static int hash4(a, b, c, d) => 134 static int hash4(a, b, c, d) =>
135 finish(combine(combine(combine(combine(0, a), b), c), d)); 135 finish(combine(combine(combine(combine(0, a), b), c), d));
136 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698