|
@@ -1,10 +1,9 @@
|
|
using System.Windows.Input;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media;
|
|
using PixiEditor.Models.DataHolders;
|
|
using PixiEditor.Models.DataHolders;
|
|
-using PixiEditor.Models.Enums;
|
|
|
|
using PixiEditor.Models.Layers;
|
|
using PixiEditor.Models.Layers;
|
|
using PixiEditor.Models.Position;
|
|
using PixiEditor.Models.Position;
|
|
-using PixiEditor.Models.Tools.ToolSettings;
|
|
|
|
|
|
+using PixiEditor.Models.Tools.ToolSettings.Settings;
|
|
using PixiEditor.Models.Tools.ToolSettings.Toolbars;
|
|
using PixiEditor.Models.Tools.ToolSettings.Toolbars;
|
|
|
|
|
|
namespace PixiEditor.Models.Tools.Tools
|
|
namespace PixiEditor.Models.Tools.Tools
|
|
@@ -12,20 +11,20 @@ namespace PixiEditor.Models.Tools.Tools
|
|
public class PenTool : BitmapOperationTool
|
|
public class PenTool : BitmapOperationTool
|
|
{
|
|
{
|
|
public override ToolType ToolType => ToolType.Pen;
|
|
public override ToolType ToolType => ToolType.Pen;
|
|
- private readonly int _toolSizeIndex;
|
|
|
|
|
|
+ private readonly Setting<int> _toolSizeSetting;
|
|
|
|
|
|
public PenTool()
|
|
public PenTool()
|
|
{
|
|
{
|
|
Cursor = Cursors.Pen;
|
|
Cursor = Cursors.Pen;
|
|
Tooltip = "Standard brush (B)";
|
|
Tooltip = "Standard brush (B)";
|
|
Toolbar = new BasicToolbar();
|
|
Toolbar = new BasicToolbar();
|
|
- _toolSizeIndex = Toolbar.Settings.IndexOf(Toolbar.GetSetting("ToolSize"));
|
|
|
|
|
|
+ _toolSizeSetting = Toolbar.GetSetting<int>("ToolSize");
|
|
}
|
|
}
|
|
|
|
|
|
public override LayerChange[] Use(Layer layer, Coordinates[] coordinates, Color color)
|
|
public override LayerChange[] Use(Layer layer, Coordinates[] coordinates, Color color)
|
|
{
|
|
{
|
|
Coordinates startingCords = coordinates.Length > 1 ? coordinates[1] : coordinates[0];
|
|
Coordinates startingCords = coordinates.Length > 1 ? coordinates[1] : coordinates[0];
|
|
- var pixels = Draw(startingCords, coordinates[0], color, (int) Toolbar.Settings[_toolSizeIndex].Value);
|
|
|
|
|
|
+ var pixels = Draw(startingCords, coordinates[0], color, _toolSizeSetting.Value);
|
|
return Only(pixels, layer);
|
|
return Only(pixels, layer);
|
|
}
|
|
}
|
|
|
|
|