|
@@ -137,18 +137,14 @@ internal class VectorPathToolExecutor : UpdateableChangeExecutor, IPathExecutorF
|
|
|
|
|
|
public override void OnLeftMouseButtonDown(MouseOnCanvasEventArgs args)
|
|
|
{
|
|
|
- bool allClosed = WholePathClosed();
|
|
|
- if (!isValidPathLayer || allClosed)
|
|
|
+ if (args.KeyModifiers.HasFlag(KeyModifiers.Shift))
|
|
|
{
|
|
|
- if (NeedsNewLayer(document.SelectedStructureMember, document.AnimationHandler.ActiveFrameTime))
|
|
|
- {
|
|
|
- Guid? created =
|
|
|
- document.Operations.CreateStructureMember(typeof(VectorLayerNode), ActionSource.Automated);
|
|
|
+ Guid? created =
|
|
|
+ document.Operations.CreateStructureMember(typeof(VectorLayerNode), ActionSource.Automated);
|
|
|
|
|
|
- if (created is null) return;
|
|
|
+ if (created is null) return;
|
|
|
|
|
|
- document.Operations.SetSelectedMember(created.Value);
|
|
|
- }
|
|
|
+ document.Operations.SetSelectedMember(created.Value);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -205,7 +201,8 @@ internal class VectorPathToolExecutor : UpdateableChangeExecutor, IPathExecutorF
|
|
|
private void AddToUndo(VectorPath path)
|
|
|
{
|
|
|
internals.ActionAccumulator.AddFinishedActions(new EndSetShapeGeometry_Action(),
|
|
|
- new SetShapeGeometry_Action(member.Id, ConstructShapeData(path), VectorShapeChangeType.GeometryData), new EndSetShapeGeometry_Action());
|
|
|
+ new SetShapeGeometry_Action(member.Id, ConstructShapeData(path), VectorShapeChangeType.GeometryData),
|
|
|
+ new EndSetShapeGeometry_Action());
|
|
|
}
|
|
|
|
|
|
private PathVectorData ConstructShapeData(VectorPath? path)
|
|
@@ -259,17 +256,6 @@ internal class VectorPathToolExecutor : UpdateableChangeExecutor, IPathExecutorF
|
|
|
document.SnappingHandler.SnappingController.HighlightedPoint = null;
|
|
|
}
|
|
|
|
|
|
- private bool NeedsNewLayer(IStructureMemberHandler? member, KeyFrameTime frameTime)
|
|
|
- {
|
|
|
- var shapeData = (member as IVectorLayerHandler).GetShapeData(frameTime);
|
|
|
- if (shapeData is null)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- return shapeData is not IReadOnlyPathData pathData || pathData.Path.IsClosed;
|
|
|
- }
|
|
|
-
|
|
|
private void ApplySettings(PathVectorData pathData)
|
|
|
{
|
|
|
toolbar.ToolSize = pathData.StrokeWidth;
|