Remove `PartialCurve::with_path`

This commit is contained in:
Hanno Braun 2022-11-11 14:24:38 +01:00
parent 6772f0d559
commit a1638400df
3 changed files with 14 additions and 14 deletions

View File

@ -39,9 +39,11 @@ impl TransformObject for PartialCurve {
// Don't need to transform `self.path`, as that's defined in surface
// coordinates, and thus transforming `surface` takes care of it.
Ok(Self::default()
.with_surface(surface)
.with_path(self.path)
.with_global_form(global_form))
Ok(PartialCurve {
path: self.path,
..Default::default()
}
.with_surface(surface)
.with_global_form(global_form))
}
}

View File

@ -36,13 +36,19 @@ impl CurveBuilder for PartialCurve {
}
fn update_as_circle_from_radius(self, radius: impl Into<Scalar>) -> Self {
self.with_path(Some(SurfacePath::circle_from_radius(radius)))
Self {
path: Some(SurfacePath::circle_from_radius(radius)),
..self
}
}
fn update_as_line_from_points(
self,
points: [impl Into<Point<2>>; 2],
) -> Self {
self.with_path(Some(SurfacePath::line_from_points(points)))
Self {
path: Some(SurfacePath::line_from_points(points)),
..self
}
}
}

View File

@ -22,14 +22,6 @@ pub struct PartialCurve {
}
impl PartialCurve {
/// Provide a path for the partial curve
pub fn with_path(mut self, path: Option<SurfacePath>) -> Self {
if let Some(path) = path {
self.path = Some(path);
}
self
}
/// Provide a surface for the partial curve
pub fn with_surface(mut self, surface: Option<Handle<Surface>>) -> Self {
if let Some(surface) = surface {