diff options
author | Minijackson <minijackson@riseup.net> | 2023-01-04 09:35:17 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2023-01-04 09:35:17 +0100 |
commit | c407a7772e5354bbd13447f7e217e526d662d6cb (patch) | |
tree | 4dc0f8f7896c4a1ced8fbdd4a003f1153fed9e2b /core/src/solving.rs | |
parent | 119e437cb0ef543cf4652bbb7700870b49ac9227 (diff) | |
download | diaphragm-c407a7772e5354bbd13447f7e217e526d662d6cb.tar.gz diaphragm-c407a7772e5354bbd13447f7e217e526d662d6cb.zip |
core: re-add StraightPath core shape
Diffstat (limited to 'core/src/solving.rs')
-rw-r--r-- | core/src/solving.rs | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/core/src/solving.rs b/core/src/solving.rs index 261b4d4..bf5fe95 100644 --- a/core/src/solving.rs +++ b/core/src/solving.rs | |||
@@ -1,4 +1,7 @@ | |||
1 | use crate::core_shapes::{CoreDrawable, CoreShape, DefinedCoreDrawable, DefinedCoreShape}; | 1 | use crate::core_shapes::{ |
2 | CoreDrawable, CoreShape, DefinedCoreDrawable, DefinedCoreShape, DefinedStraightPath, | ||
3 | StraightPath, | ||
4 | }; | ||
2 | 5 | ||
3 | use super::styles::*; | 6 | use super::styles::*; |
4 | use super::text::*; | 7 | use super::text::*; |
@@ -155,6 +158,7 @@ impl Constrainable for CoreShape { | |||
155 | match self { | 158 | match self { |
156 | CoreShape::Rectangle(r) => Some(DefinedCoreShape::Rectangle(*r)), | 159 | CoreShape::Rectangle(r) => Some(DefinedCoreShape::Rectangle(*r)), |
157 | CoreShape::Text(t) => t.fixate(model).map(DefinedCoreShape::Text), | 160 | CoreShape::Text(t) => t.fixate(model).map(DefinedCoreShape::Text), |
161 | CoreShape::StraightPath(p) => p.fixate(model).map(DefinedCoreShape::StraightPath), | ||
158 | } | 162 | } |
159 | } | 163 | } |
160 | } | 164 | } |
@@ -288,15 +292,15 @@ impl Constrainable for Text { | |||
288 | } | 292 | } |
289 | } | 293 | } |
290 | 294 | ||
291 | // impl Constrainable for StraightPath { | 295 | impl Constrainable for StraightPath { |
292 | // type Fixated = DefinedStraightPath; | 296 | type Fixated = DefinedStraightPath; |
293 | // | 297 | |
294 | // fn fixate(&self, model: &dyn SolverModel) -> Option<Self::Fixated> { | 298 | fn fixate(&self, model: &dyn SolverModel) -> Option<Self::Fixated> { |
295 | // let points: Option<_> = self | 299 | let points: Option<_> = self |
296 | // .points | 300 | .points |
297 | // .iter() | 301 | .iter() |
298 | // .map(|point| point.fixate(model)) | 302 | .map(|point| point.fixate(model)) |
299 | // .collect(); | 303 | .collect(); |
300 | // Some(DefinedStraightPath { points: points? }) | 304 | Some(DefinedStraightPath { points: points? }) |
301 | // } | 305 | } |
302 | // } | 306 | } |