Fix shape not closed after using Fill Tool (#510)

* Always set shape property 'closed' on fill

* Remove closed property on Shape

* Make color mandatory in Fill

* Fix intersection for filled but open shapes

* Code style tweak

* Add TODO note to rework ClosePath check
This commit is contained in:
Paul Kupper
2022-02-06 23:06:23 +01:00
committed by Keavon Chambers
parent 4d232e6b46
commit 3fc517e1c4
10 changed files with 32 additions and 47 deletions

View File

@@ -151,7 +151,8 @@ impl DocumentMessageHandler {
};
let (path, closed) = match &layer.ok()?.data {
LayerDataType::Shape(shape) => Some((shape.path.clone(), shape.closed)),
// TODO: This ClosePath check does not handle all cases, fix this soon
LayerDataType::Shape(shape) => Some((shape.path.clone(), shape.path.elements().last() == Some(&kurbo::PathEl::ClosePath))),
LayerDataType::Text(text) => Some((text.to_bez_path_nonmut(), true)),
_ => None,
}?;