Fix crash on deleting all subpaths (#1460)

* Fix crash on deleting all subpaths

* Delete layer if no manipulators exist
This commit is contained in:
0HyperCube
2023-11-16 15:42:21 -08:00
committed by GitHub
parent de235e3be1
commit 8a816cd701
3 changed files with 13 additions and 0 deletions
+3
View File
@@ -141,6 +141,9 @@ impl<ManipulatorGroupId: crate::Identifier> Subpath<ManipulatorGroupId> {
/// Write the curve argument to the string (the d="..." part)
pub fn subpath_to_svg(&self, svg: &mut String, transform: glam::DAffine2) -> std::fmt::Result {
if self.is_empty() {
return Ok(());
}
let start = transform.transform_point2(self[0].anchor);
write!(svg, "{SVG_ARG_MOVE}{},{}", start.x, start.y)?;
for bezier in self.iter() {