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

Side by Side Diff: samples/ui_lib/base/Size.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/ui_lib/base/AnimationScheduler.dart ('k') | samples/ui_lib/observable/ChangeEvent.dart » ('j') | no next file with comments »
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 * A utility class for representing two-dimensional sizes. 6 * A utility class for representing two-dimensional sizes.
7 */ 7 */
8 class Size { 8 class Size {
9 num width; 9 num width;
10 num height; 10 num height;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 * Returns the shorter of the two dimensions in the size. 76 * Returns the shorter of the two dimensions in the size.
77 */ 77 */
78 num getShortest() { 78 num getShortest() {
79 return min(width, height); 79 return min(width, height);
80 } 80 }
81 81
82 /** 82 /**
83 * Returns true if the size has zero area, false if both dimensions 83 * Returns true if the size has zero area, false if both dimensions
84 * are non-zero numbers. 84 * are non-zero numbers.
85 */ 85 */
86 bool isEmpty() { 86 bool get isEmpty {
87 return area() == 0; 87 return area() == 0;
88 } 88 }
89 89
90 /** 90 /**
91 * Returns the perimeter of the size (width + height) * 2. 91 * Returns the perimeter of the size (width + height) * 2.
92 */ 92 */
93 num perimeter() { 93 num perimeter() {
94 return (width + height) * 2; 94 return (width + height) * 2;
95 } 95 }
96 96
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 /** 131 /**
132 * Returns a nice string representing size. 132 * Returns a nice string representing size.
133 * Returns in the form (50 x 73). 133 * Returns in the form (50 x 73).
134 */ 134 */
135 String toString() { 135 String toString() {
136 return "(${width} x ${height})"; 136 return "(${width} x ${height})";
137 } 137 }
138 } 138 }
OLDNEW
« no previous file with comments | « samples/ui_lib/base/AnimationScheduler.dart ('k') | samples/ui_lib/observable/ChangeEvent.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698