Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Make RRect useful#2147

Merged
Hixie merged 1 commit intoflutter:masterfrom
Hixie:RRect
Dec 7, 2015
Merged

Make RRect useful#2147
Hixie merged 1 commit intoflutter:masterfrom
Hixie:RRect

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Dec 6, 2015

Other changes:

  • Remove the default constructor for RRect and Rect.
  • Add trailing periods to Offset comments.
  • Add Offset.distanceSquared for people who want to compare x^2+y^2
    to r^2 without paying the cost of the sqrt. (Corresponding fix to
    OvalRect coming in a separate flutter patch.)
  • Fix a bug in Rect.lerp().
  • Fix various Rect comments.
  • Remove a "var" in Rect.

Fixes flutter/flutter#769.

@Hixie Hixie force-pushed the RRect branch 6 times, most recently from 9b0efaf to cf29ec3 Compare December 7, 2015 00:07
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, you can have a separate radius for top and bottom as well. That's pretty rare though (and we haven't supported it up to this point).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could in theory have separate x and y radii for each individual corner. Right now we only support kEmpty_Type, kRect_Type, kOval_Type, and kSimple_Type skia RRect types. Skia supports kNinePatch_Type and kComplex_Type but those aren't exposed here at all.

@abarth
Copy link
Contributor

abarth commented Dec 7, 2015

LGTM

@abarth
Copy link
Contributor

abarth commented Dec 7, 2015

I mean, the hard-coded numbers are fine too. Maybe it's better with the numeral since we address into the array with numerals in lots of places in this file already.

@Hixie
Copy link
Contributor Author

Hixie commented Dec 7, 2015

How about a constant, that way if you copy-pasta the code out, you at least see that there's something to change.

Other changes:
 - Remove the default constructor for RRect and Rect.
 - Add trailing periods to Offset comments.
 - Add Offset.distanceSquared for people who want to compare x^2+y^2
   to r^2 without paying the cost of the sqrt. (Corresponding fix to
   OvalRect coming in a separate flutter patch.)
 - Fix a bug in Rect.lerp().
 - Fix various Rect comments.
 - Remove a "var" in Rect.

Fixes flutter#769.
Hixie added a commit that referenced this pull request Dec 7, 2015
@Hixie Hixie merged commit 66b4b8d into flutter:master Dec 7, 2015
@Hixie Hixie deleted the RRect branch December 7, 2015 02:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RRect is worthless

2 participants