forge
Explore
Log in

Don't you dare go Hollow

Don't expand zero radius per corner

Browse files at this commit

2dff67447082f3c000b7eb68b4826f5b3db7397bIvan MolodetskikhParent: 23850e1
So that radii like 8 8 0 0 look properly.
niri-config/src/lib.rsmodified+13 -10
@@ -1129,18 +1129,21 @@ impl CornerRadius {
11291129 }
11301130 }
11311131
1132- pub fn expanded_by(self, width: f32) -> Self {
1133- // Preserve zero radius.
1134- if self == Self::default() {
1135- return self;
1132+ pub fn expanded_by(mut self, width: f32) -> Self {
1133+ if self.top_left > 0. {
1134+ self.top_left += width;
11361135 }
1137-
1138- Self {
1139- top_left: self.top_left + width,
1140- top_right: self.top_right + width,
1141- bottom_right: self.bottom_right + width,
1142- bottom_left: self.bottom_left + width,
1136+ if self.top_right > 0. {
1137+ self.top_right += width;
1138+ }
1139+ if self.bottom_right > 0. {
1140+ self.bottom_right += width;
11431141 }
1142+ if self.bottom_left > 0. {
1143+ self.bottom_left += width;
1144+ }
1145+
1146+ self
11441147 }
11451148
11461149 pub fn scaled_by(self, scale: f32) -> Self {