|
@@ -1,14 +1,12 @@
|
|
|
using PixiEditor.ChangeableDocument.Actions;
|
|
|
using PixiEditor.ChangeableDocument.Actions.Generated;
|
|
|
using Drawie.Backend.Core.ColorsImpl;
|
|
|
-using Drawie.Backend.Core.Numerics;
|
|
|
using PixiEditor.Extensions.CommonApi.Palettes;
|
|
|
using PixiEditor.Models.Handlers;
|
|
|
using PixiEditor.Models.Handlers.Toolbars;
|
|
|
using PixiEditor.Models.Handlers.Tools;
|
|
|
using PixiEditor.Models.Tools;
|
|
|
using Drawie.Numerics;
|
|
|
-using PixiEditor.ViewModels.Tools.ToolSettings.Toolbars;
|
|
|
|
|
|
namespace PixiEditor.Models.DocumentModels.UpdateableChangeExecutors;
|
|
|
#nullable enable
|
|
@@ -20,6 +18,8 @@ internal class PenToolExecutor : UpdateableChangeExecutor
|
|
|
private bool drawOnMask;
|
|
|
private bool pixelPerfect;
|
|
|
private bool antiAliasing;
|
|
|
+ private float hardness;
|
|
|
+ private float spacing = 1;
|
|
|
|
|
|
private IBasicToolbar basicToolbar;
|
|
|
|
|
@@ -42,11 +42,13 @@ internal class PenToolExecutor : UpdateableChangeExecutor
|
|
|
color = colorsHandler.PrimaryColor;
|
|
|
pixelPerfect = penTool.PixelPerfectEnabled;
|
|
|
antiAliasing = penTool.AntiAliasing;
|
|
|
+ hardness = penTool.Hardness;
|
|
|
+ spacing = penTool.Spacing;
|
|
|
|
|
|
colorsHandler.AddSwatch(new PaletteColor(color.R, color.G, color.B));
|
|
|
IAction? action = pixelPerfect switch
|
|
|
{
|
|
|
- false => new LineBasedPen_Action(guidValue, color, controller!.LastPixelPosition, ToolSize, false, antiAliasing, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
|
+ false => new LineBasedPen_Action(guidValue, color, controller!.LastPixelPosition, ToolSize, false, antiAliasing, hardness, spacing, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
|
true => new PixelPerfectPen_Action(guidValue, controller!.LastPixelPosition, color, drawOnMask, document!.AnimationHandler.ActiveFrameBindable)
|
|
|
};
|
|
|
internals!.ActionAccumulator.AddActions(action);
|
|
@@ -58,7 +60,7 @@ internal class PenToolExecutor : UpdateableChangeExecutor
|
|
|
{
|
|
|
IAction? action = pixelPerfect switch
|
|
|
{
|
|
|
- false => new LineBasedPen_Action(guidValue, color, pos, ToolSize, false, antiAliasing, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
|
+ false => new LineBasedPen_Action(guidValue, color, pos, ToolSize, false, antiAliasing, hardness, spacing, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
|
true => new PixelPerfectPen_Action(guidValue, pos, color, drawOnMask, document!.AnimationHandler.ActiveFrameBindable)
|
|
|
};
|
|
|
internals!.ActionAccumulator.AddActions(action);
|