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

Issue 135273009: Make Rectangle and MutableRectangle constructors handle negative lengths. (Closed)

Created:
6 years, 10 months ago by Lasse Reichstein Nielsen
Modified:
6 years, 10 months ago
Reviewers:
Emily Fortuna, srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make Rectangle and MutableRectangle constructors handle negative lengths. Now handles negative width/height so that it's equivalent to new Rectangle.fromPoints(new Point(left, top), new Point(left + width, top + height)) BUG= http://dartbug.com/16167 R=efortuna@google.com Committed: https://code.google.com/p/dart/source/detail?r=32736

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add documentation for constructors. #

Patch Set 3 : Disallow setting a negative width and height. #

Patch Set 4 : Remember to rebuild HTML. #

Patch Set 5 : Add test for negative lengths. #

Patch Set 6 : Make negative lengths be truncated to zero instead of trying to be smart. #

Patch Set 7 : Remove unnecessary T's. #

Total comments: 13

Patch Set 8 : Address comments. Update tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -14 lines) Patch
M sdk/lib/html/dart2js/html_dart2js.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M sdk/lib/math/rectangle.dart View 1 2 3 4 5 6 7 5 chunks +120 lines, -8 lines 0 comments Download
M tests/lib/math/rectangle_test.dart View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download
M tools/dom/src/CssRectangle.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (0 generated)
Lasse Reichstein Nielsen
Are there any HTML rectangles that needs adapting too?
6 years, 10 months ago (2014-01-28 15:35:12 UTC) #1
srdjan
https://codereview.chromium.org/135273009/diff/1/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/1/sdk/lib/math/rectangle.dart#newcode141 sdk/lib/math/rectangle.dart:141: height = (height >= 0) ? height : -height; ...
6 years, 10 months ago (2014-01-28 16:47:41 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/135273009/diff/1/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/1/sdk/lib/math/rectangle.dart#newcode141 sdk/lib/math/rectangle.dart:141: height = (height >= 0) ? height : -height; ...
6 years, 10 months ago (2014-01-28 17:49:59 UTC) #3
Emily Fortuna
Do we really want to silently modify and return the absolute value of the negative ...
6 years, 10 months ago (2014-01-29 19:07:01 UTC) #4
Lasse Reichstein Nielsen
On 2014/01/29 19:07:01, Emily Fortuna wrote: > Do we really want to silently modify and ...
6 years, 10 months ago (2014-01-30 06:55:47 UTC) #5
Lasse Reichstein Nielsen
I'm starting to like truncating negative lengths to zero instead of trying to reverse the ...
6 years, 10 months ago (2014-01-30 13:32:47 UTC) #6
Lasse Reichstein Nielsen
PTAL if this is better than the previous version. https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart#newcode215 sdk/lib/math/rectangle.dart:215: ...
6 years, 10 months ago (2014-01-30 13:42:34 UTC) #7
srdjan
https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart#newcode145 sdk/lib/math/rectangle.dart:145: * If `width` is negative, it is truncated to ...
6 years, 10 months ago (2014-01-30 15:28:44 UTC) #8
Emily Fortuna
looks good with adjustments. https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart#newcode152 sdk/lib/math/rectangle.dart:152: : this.width = (width >= ...
6 years, 10 months ago (2014-01-30 18:35:13 UTC) #9
srdjan
https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart#newcode152 sdk/lib/math/rectangle.dart:152: : this.width = (width >= 0) ? width : ...
6 years, 10 months ago (2014-01-30 18:46:40 UTC) #10
Emily Fortuna
lgtm. https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart#newcode152 sdk/lib/math/rectangle.dart:152: : this.width = (width >= 0) ? width ...
6 years, 10 months ago (2014-01-30 18:56:23 UTC) #11
Lasse Reichstein Nielsen
https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart File sdk/lib/math/rectangle.dart (right): https://codereview.chromium.org/135273009/diff/120001/sdk/lib/math/rectangle.dart#newcode145 sdk/lib/math/rectangle.dart:145: * If `width` is negative, it is truncated to ...
6 years, 10 months ago (2014-01-31 08:51:53 UTC) #12
Lasse Reichstein Nielsen
6 years, 10 months ago (2014-02-18 10:12:33 UTC) #13
Message was sent while issue was closed.
Committed patchset #8 manually as r32736 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698