Fix deleting the first control point not working

This commit is contained in:
smoogipoo 2019-12-06 18:49:14 +09:00
parent 16f8341a02
commit 52dd7bf716
1 changed files with 7 additions and 0 deletions

View File

@ -108,7 +108,14 @@ private bool deleteSelected()
return false;
foreach (var c in toRemove)
{
// The first control point in the slider must have a type, so take it from the previous "first" one
// Todo: Should be handled within SliderPath itself
if (c == slider.Path.ControlPoints[0] && slider.Path.ControlPoints.Count > 1 && slider.Path.ControlPoints[1].Type.Value == null)
slider.Path.ControlPoints[1].Type.Value = slider.Path.ControlPoints[0].Type.Value;
slider.Path.ControlPoints.Remove(c);
}
// If there are 0 remaining control points, treat the slider as being deleted
if (slider.Path.ControlPoints.Count == 0)