diff options
author | Minijackson <minijackson@riseup.net> | 2023-02-03 19:59:43 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2023-02-03 19:59:43 +0100 |
commit | 82ffe3187a32bad4ecca0736882a23793a800822 (patch) | |
tree | 2d3ab9231b76dadcf2ab69b27053df6cc66bead1 /core/src/solving.rs | |
parent | c8bb3e4a24ca1ca6ec1a57c9e8cd8655483b3eb0 (diff) | |
download | diaphragm-82ffe3187a32bad4ecca0736882a23793a800822.tar.gz diaphragm-82ffe3187a32bad4ecca0736882a23793a800822.zip |
add support for images, and some chores
- SVG files not yet supported
- Remove dead commented code
- Add inherent constraints for text, path, and images
- Formatting
Diffstat (limited to 'core/src/solving.rs')
-rw-r--r-- | core/src/solving.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/src/solving.rs b/core/src/solving.rs index bfe3ff3..63e4562 100644 --- a/core/src/solving.rs +++ b/core/src/solving.rs | |||
@@ -176,11 +176,13 @@ pub trait Constrainable { | |||
176 | impl Constrainable for CoreShape { | 176 | impl Constrainable for CoreShape { |
177 | type Fixated = DefinedCoreShape; | 177 | type Fixated = DefinedCoreShape; |
178 | 178 | ||
179 | // TODO: why &self, why not self? | ||
179 | fn fixate(&self, model: &dyn SolverModel) -> Option<Self::Fixated> { | 180 | fn fixate(&self, model: &dyn SolverModel) -> Option<Self::Fixated> { |
180 | match self { | 181 | match self { |
181 | CoreShape::Rectangle(r) => Some(DefinedCoreShape::Rectangle(*r)), | 182 | CoreShape::Rectangle(r) => Some(DefinedCoreShape::Rectangle(*r)), |
182 | CoreShape::Text(t) => t.fixate(model).map(DefinedCoreShape::Text), | 183 | CoreShape::Text(t) => t.fixate(model).map(DefinedCoreShape::Text), |
183 | CoreShape::StraightPath(p) => p.fixate(model).map(DefinedCoreShape::StraightPath), | 184 | CoreShape::StraightPath(p) => p.fixate(model).map(DefinedCoreShape::StraightPath), |
185 | CoreShape::Image(i) => Some(DefinedCoreShape::Image(i.clone())), | ||
184 | } | 186 | } |
185 | } | 187 | } |
186 | } | 188 | } |