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 {
1129 }1129 }
1130 }1130 }
1131 1131
1132- pub fn expanded_by(self, width: f32) -> Self {1132+ pub fn expanded_by(mut self, width: f32) -> Self {
1133- // Preserve zero radius.1133+ if self.top_left > 0. {
1134- if self == Self::default() {1134+ self.top_left += width;
1135- return self;
1136 }1135 }
1137-1136+ if self.top_right > 0. {
1138- Self {1137+ self.top_right += width;
1139- top_left: self.top_left + width,1138+ }
1140- top_right: self.top_right + width,1139+ if self.bottom_right > 0. {
1141- bottom_right: self.bottom_right + width,1140+ self.bottom_right += width;
1142- bottom_left: self.bottom_left + width,
1143 }1141 }
1142+ if self.bottom_left > 0. {
1143+ self.bottom_left += width;
1144+ }
1145+
1146+ self
1144 }1147 }
1145 1148
1146 pub fn scaled_by(self, scale: f32) -> Self {1149 pub fn scaled_by(self, scale: f32) -> Self {