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

Side by Side Diff: sdk/lib/math/rectangle.dart

Issue 50833003: Updated rectangle documentation to explain coordinate system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | no next file » | 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) 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 part of dart.math; 4 part of dart.math;
5 5
6 /** 6 /**
7 * A base class for representing two-dimensional axis-aligned rectangles. 7 * A base class for representing two-dimensional axis-aligned rectangles.
8 *
9 * This rectangle uses a left-handed Cartesian coordinate system, with x
10 * directed to the right but y directed down, as per the convention in 2D
floitsch 2013/10/31 00:36:59 s/but/and/
11 * computer graphics.
12 *
13 * See also:
14 * [W3C Coordinate Systems Specification](http://www.w3.org/TR/SVG/coords.htm l#InitialCoordinateSystem).
8 */ 15 */
9 abstract class _RectangleBase<T extends num> { 16 abstract class _RectangleBase<T extends num> {
10 const _RectangleBase(); 17 const _RectangleBase();
11 18
12 /** The x-coordinate of the left edge. */ 19 /** The x-coordinate of the left edge. */
13 T get left; 20 T get left;
14 /** The y-coordinate of the top edge. */ 21 /** The y-coordinate of the top edge. */
15 T get top; 22 T get top;
16 /** The `width` of the rectangle. */ 23 /** The `width` of the rectangle. */
17 T get width; 24 T get width;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 MutableRectangle(this.left, this.top, this.width, this.height); 155 MutableRectangle(this.left, this.top, this.width, this.height);
149 156
150 factory MutableRectangle.fromPoints(Point<T> a, Point<T> b) { 157 factory MutableRectangle.fromPoints(Point<T> a, Point<T> b) {
151 T left = min(a.x, b.x); 158 T left = min(a.x, b.x);
152 T width = max(a.x, b.x) - left; 159 T width = max(a.x, b.x) - left;
153 T top = min(a.y, b.y); 160 T top = min(a.y, b.y);
154 T height = max(a.y, b.y) - top; 161 T height = max(a.y, b.y) - top;
155 return new MutableRectangle<T>(left, top, width, height); 162 return new MutableRectangle<T>(left, top, width, height);
156 } 163 }
157 } 164 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698