Add an RRect.isRect property (flutter/engine#3908)

This commit is contained in:
Jason Simmons
2017-07-19 17:30:31 -07:00
committed by GitHub
parent 79a8d775b6
commit 7d72fbe1c5

View File

@@ -1149,6 +1149,15 @@ class RRect {
/// Negative areas are considered empty.
bool get isEmpty => left >= right || top >= bottom;
/// Whether this rounded rectangle is a simple rectangle with zero
/// corner radii.
bool get isRect {
return (tlRadiusX == 0.0 || tlRadiusY == 0.0) &&
(trRadiusX == 0.0 || trRadiusY == 0.0) &&
(blRadiusX == 0.0 || blRadiusY == 0.0) &&
(brRadiusX == 0.0 || brRadiusY == 0.0);
}
/// Whether this rounded rectangle has a side with no straight section.
bool get isStadium {
return (