Skip to content

Commit 784905e

Browse files
Add an RRect.isRect property (flutter#3908)
1 parent 536fb27 commit 784905e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/ui/geometry.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,15 @@ class RRect {
11491149
/// Negative areas are considered empty.
11501150
bool get isEmpty => left >= right || top >= bottom;
11511151

1152+
/// Whether this rounded rectangle is a simple rectangle with zero
1153+
/// corner radii.
1154+
bool get isRect {
1155+
return (tlRadiusX == 0.0 || tlRadiusY == 0.0) &&
1156+
(trRadiusX == 0.0 || trRadiusY == 0.0) &&
1157+
(blRadiusX == 0.0 || blRadiusY == 0.0) &&
1158+
(brRadiusX == 0.0 || brRadiusY == 0.0);
1159+
}
1160+
11521161
/// Whether this rounded rectangle has a side with no straight section.
11531162
bool get isStadium {
11541163
return (

0 commit comments

Comments
 (0)