Skip to content

Commit 4b9da5f

Browse files
authored
Remove StrokeKind::default (#5658)
Since there is no natural default for `RectShape`.
1 parent 04fca9c commit 4b9da5f

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

crates/epaint/src/stroke.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,24 @@ pub enum StrokeKind {
6969
Outside,
7070
}
7171

72-
impl Default for StrokeKind {
73-
fn default() -> Self {
74-
Self::Middle
75-
}
76-
}
77-
7872
/// Describes the width and color of paths. The color can either be solid or provided by a callback. For more information, see [`ColorMode`]
7973
///
8074
/// The default stroke is the same as [`Stroke::NONE`].
81-
#[derive(Clone, Debug, Default, PartialEq)]
75+
#[derive(Clone, Debug, PartialEq)]
8276
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
8377
pub struct PathStroke {
8478
pub width: f32,
8579
pub color: ColorMode,
8680
pub kind: StrokeKind,
8781
}
8882

83+
impl Default for PathStroke {
84+
#[inline]
85+
fn default() -> Self {
86+
Self::NONE
87+
}
88+
}
89+
8990
impl PathStroke {
9091
/// Same as [`PathStroke::default`].
9192
pub const NONE: Self = Self {
@@ -99,7 +100,7 @@ impl PathStroke {
99100
Self {
100101
width: width.into(),
101102
color: ColorMode::Solid(color.into()),
102-
kind: StrokeKind::default(),
103+
kind: StrokeKind::Middle,
103104
}
104105
}
105106

@@ -114,7 +115,7 @@ impl PathStroke {
114115
Self {
115116
width: width.into(),
116117
color: ColorMode::UV(Arc::new(callback)),
117-
kind: StrokeKind::default(),
118+
kind: StrokeKind::Middle,
118119
}
119120
}
120121

@@ -168,7 +169,7 @@ impl From<Stroke> for PathStroke {
168169
Self {
169170
width: value.width,
170171
color: ColorMode::Solid(value.color),
171-
kind: StrokeKind::default(),
172+
kind: StrokeKind::Middle,
172173
}
173174
}
174175
}

0 commit comments

Comments
 (0)