From 7d72fbe1c55051a83dabb72244ce140ca206cec2 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 19 Jul 2017 17:30:31 -0700 Subject: [PATCH] Add an RRect.isRect property (flutter/engine#3908) --- engine/src/flutter/lib/ui/geometry.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/src/flutter/lib/ui/geometry.dart b/engine/src/flutter/lib/ui/geometry.dart index b0b5efee2d..506bad18e6 100644 --- a/engine/src/flutter/lib/ui/geometry.dart +++ b/engine/src/flutter/lib/ui/geometry.dart @@ -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 (