|
@@ -12,6 +12,7 @@ using System.Collections.Generic;
|
|
|
using System.Collections.ObjectModel;
|
|
|
using System.Diagnostics;
|
|
|
using System.Linq;
|
|
|
+using System.Windows;
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
namespace PixiEditor.Models.Controllers
|
|
@@ -234,7 +235,7 @@ namespace PixiEditor.Models.Controllers
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (ToolSize != previewLayerSize)
|
|
|
+ if (ToolSize != previewLayerSize || ActiveDocument.PreviewLayer.IsCleared)
|
|
|
{
|
|
|
cachedHighlight = CoordinatesCalculator.RectangleToCoordinates(
|
|
|
CoordinatesCalculator.CalculateThicknessCenter(newPosition, ToolSize));
|
|
@@ -244,10 +245,13 @@ namespace PixiEditor.Models.Controllers
|
|
|
|
|
|
cachedPixels = BitmapPixelChanges.FromSingleColoredArray(cachedHighlight, new SKColor(0, 0, 0, 77));
|
|
|
|
|
|
+ if (!ActiveDocument.PreviewLayer.IsCleared)
|
|
|
+ ActiveDocument.PreviewLayer.Clear();
|
|
|
ActiveDocument.PreviewLayer.SetPixels(cachedPixels);
|
|
|
}
|
|
|
|
|
|
Coordinates start = newPosition - halfSize;
|
|
|
+ ActiveDocument.PreviewLayer.Offset = new Thickness(start.X, start.Y, 0, 0);
|
|
|
|
|
|
if (!IsInsideBounds(cachedHighlight))
|
|
|
{
|