|
@@ -8,6 +8,7 @@ using PixiEditor.Models.Handlers.Toolbars;
|
|
using PixiEditor.Models.Handlers.Tools;
|
|
using PixiEditor.Models.Handlers.Tools;
|
|
using PixiEditor.Models.Tools;
|
|
using PixiEditor.Models.Tools;
|
|
using PixiEditor.Numerics;
|
|
using PixiEditor.Numerics;
|
|
|
|
+using PixiEditor.ViewModels.Tools.ToolSettings.Toolbars;
|
|
|
|
|
|
namespace PixiEditor.Models.DocumentModels.UpdateableChangeExecutors;
|
|
namespace PixiEditor.Models.DocumentModels.UpdateableChangeExecutors;
|
|
#nullable enable
|
|
#nullable enable
|
|
@@ -15,10 +16,12 @@ internal class PenToolExecutor : UpdateableChangeExecutor
|
|
{
|
|
{
|
|
private Guid guidValue;
|
|
private Guid guidValue;
|
|
private Color color;
|
|
private Color color;
|
|
- private int toolSize;
|
|
|
|
|
|
+ public int ToolSize => basicToolbar.ToolSize;
|
|
private bool drawOnMask;
|
|
private bool drawOnMask;
|
|
private bool pixelPerfect;
|
|
private bool pixelPerfect;
|
|
|
|
|
|
|
|
+ private IBasicToolbar basicToolbar;
|
|
|
|
+
|
|
public override ExecutionState Start()
|
|
public override ExecutionState Start()
|
|
{
|
|
{
|
|
IStructureMemberHandler? member = document!.SelectedStructureMember;
|
|
IStructureMemberHandler? member = document!.SelectedStructureMember;
|
|
@@ -33,15 +36,15 @@ internal class PenToolExecutor : UpdateableChangeExecutor
|
|
if (!drawOnMask && member is not ILayerHandler)
|
|
if (!drawOnMask && member is not ILayerHandler)
|
|
return ExecutionState.Error;
|
|
return ExecutionState.Error;
|
|
|
|
|
|
|
|
+ basicToolbar = toolbar;
|
|
guidValue = member.Id;
|
|
guidValue = member.Id;
|
|
color = colorsHandler.PrimaryColor;
|
|
color = colorsHandler.PrimaryColor;
|
|
- toolSize = toolbar.ToolSize;
|
|
|
|
pixelPerfect = penTool.PixelPerfectEnabled;
|
|
pixelPerfect = penTool.PixelPerfectEnabled;
|
|
|
|
|
|
colorsHandler.AddSwatch(new PaletteColor(color.R, color.G, color.B));
|
|
colorsHandler.AddSwatch(new PaletteColor(color.R, color.G, color.B));
|
|
IAction? action = pixelPerfect switch
|
|
IAction? action = pixelPerfect switch
|
|
{
|
|
{
|
|
- false => new LineBasedPen_Action(guidValue, color, controller!.LastPixelPosition, toolSize, false, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
|
|
|
|
+ false => new LineBasedPen_Action(guidValue, color, controller!.LastPixelPosition, ToolSize, false, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
true => new PixelPerfectPen_Action(guidValue, controller!.LastPixelPosition, color, drawOnMask, document!.AnimationHandler.ActiveFrameBindable)
|
|
true => new PixelPerfectPen_Action(guidValue, controller!.LastPixelPosition, color, drawOnMask, document!.AnimationHandler.ActiveFrameBindable)
|
|
};
|
|
};
|
|
internals!.ActionAccumulator.AddActions(action);
|
|
internals!.ActionAccumulator.AddActions(action);
|
|
@@ -53,7 +56,7 @@ internal class PenToolExecutor : UpdateableChangeExecutor
|
|
{
|
|
{
|
|
IAction? action = pixelPerfect switch
|
|
IAction? action = pixelPerfect switch
|
|
{
|
|
{
|
|
- false => new LineBasedPen_Action(guidValue, color, pos, toolSize, false, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
|
|
|
|
+ false => new LineBasedPen_Action(guidValue, color, pos, ToolSize, false, drawOnMask, document!.AnimationHandler.ActiveFrameBindable),
|
|
true => new PixelPerfectPen_Action(guidValue, pos, color, drawOnMask, document!.AnimationHandler.ActiveFrameBindable)
|
|
true => new PixelPerfectPen_Action(guidValue, pos, color, drawOnMask, document!.AnimationHandler.ActiveFrameBindable)
|
|
};
|
|
};
|
|
internals!.ActionAccumulator.AddActions(action);
|
|
internals!.ActionAccumulator.AddActions(action);
|