Bug 1606827 - A corner is not rounded when the radius is zero in either dimension (not necessarily both) r=nical
authorSimon Sapin <simon.sapin@exyr.org>
Mon, 06 Jan 2020 10:23:49 +0000
changeset 509104 5105e62fbbe6cb144a7a7a756128da326d724004
parent 509103 9c740bf48245f79144f4608ea9b3556c69135ea1
child 509105 5623ec4258ab6ad9256111716256786919d9ef42
push id36992
push userrgurzau@mozilla.com
push dateTue, 07 Jan 2020 21:57:58 +0000
treeherdermozilla-central@e728bf01a2b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1606827
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1606827 - A corner is not rounded when the radius is zero in either dimension (not necessarily both) r=nical Differential Revision: https://phabricator.services.mozilla.com/D58615
gfx/wr/webrender_api/src/display_item.rs
--- a/gfx/wr/webrender_api/src/display_item.rs
+++ b/gfx/wr/webrender_api/src/display_item.rs
@@ -1297,22 +1297,24 @@ impl BorderRadius {
             self.bottom_right == uniform_radius
         {
             Some(uniform_radius)
         } else {
             None
         }
     }
 
+    /// Return whether, in each corner, the radius in *either* direction is zero.
+    /// This means that none of the corners are rounded.
     pub fn is_zero(&self) -> bool {
-        if let Some(radius) = self.is_uniform() {
-            radius == 0.0
-        } else {
-            false
-        }
+        let corner_is_zero = |corner: &LayoutSize| corner.width == 0.0 || corner.height == 0.0;
+        corner_is_zero(&self.top_left) &&
+        corner_is_zero(&self.top_right) &&
+        corner_is_zero(&self.bottom_right) &&
+        corner_is_zero(&self.bottom_left)
     }
 }
 
 impl ComplexClipRegion {
     /// Create a new complex clip region.
     pub fn new(
         rect: LayoutRect,
         radii: BorderRadius,