diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0084dcc..81a3227 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog
+## /09/2020 - v0.8.2.2
+
+* (Fix) Tools - Move and Pattern: When not selecting a ROI will draw black layers
+* (Fix) Tool - Move: When making a cut move and move to a overlap zone it will blackout the source rectangle
+
## 14/09/2020 - v0.8.2.1
* (Improvement) When unable to convert a format from SL1 to other, advice users to check used printer on PrusaSlicer (#60)
diff --git a/UVtools.Core/Layer/Layer.cs b/UVtools.Core/Layer/Layer.cs
index be6959b..6b83ac5 100644
--- a/UVtools.Core/Layer/Layer.cs
+++ b/UVtools.Core/Layer/Layer.cs
@@ -465,10 +465,17 @@ namespace UVtools.Core
using (var srcRoi = new Mat(mat, operation.ROI))
using (var dstRoi = new Mat(mat, operation.DstRoi))
{
- srcRoi.CopyTo(dstRoi);
if (operation.IsCutMove)
{
- srcRoi.SetTo(new MCvScalar(0));
+ using (var targetRoi = srcRoi.Clone())
+ {
+ srcRoi.SetTo(new MCvScalar(0));
+ targetRoi.CopyTo(dstRoi);
+ }
+ }
+ else
+ {
+ srcRoi.CopyTo(dstRoi);
}
LayerMat = mat;
diff --git a/UVtools.Core/Operations/OperationMove.cs b/UVtools.Core/Operations/OperationMove.cs
index c663514..4258517 100644
--- a/UVtools.Core/Operations/OperationMove.cs
+++ b/UVtools.Core/Operations/OperationMove.cs
@@ -126,10 +126,9 @@ namespace UVtools.Core.Operations
public bool ValidateBounds()
{
CalculateDstRoi();
- if (DstRoi.X < 0) return false;
- if (DstRoi.Y < 0) return false;
- if (DstRoi.Right > ImageWidth) return false;
- if (DstRoi.Bottom > ImageHeight) return false;
+ if (DstRoi.IsEmpty || DstRoi.X < 0 || DstRoi.Y < 0) return false;
+ if (DstRoi.Width == 0 || DstRoi.Right > ImageWidth) return false;
+ if (DstRoi.Height == 0 || DstRoi.Bottom > ImageHeight) return false;
return true;
}
diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj
index f56572d..f39e99f 100644
--- a/UVtools.Core/UVtools.Core.csproj
+++ b/UVtools.Core/UVtools.Core.csproj
@@ -10,12 +10,12 @@
https://github.com/sn4k3/UVtools
https://github.com/sn4k3/UVtools
MSLA/DLP, file analysis, repair, conversion and manipulation
- 0.8.2.1
+ 0.8.2.2
Copyright © 2020 PTRTECH
UVtools.png
AnyCPU;x64
- 0.8.2.1
- 0.8.2.1
+ 0.8.2.2
+ 0.8.2.2
diff --git a/UVtools.GUI/Controls/CtrlToolWindowContent.cs b/UVtools.GUI/Controls/CtrlToolWindowContent.cs
index bfaf348..8fb319c 100644
--- a/UVtools.GUI/Controls/CtrlToolWindowContent.cs
+++ b/UVtools.GUI/Controls/CtrlToolWindowContent.cs
@@ -166,7 +166,7 @@ namespace UVtools.GUI.Controls
if (ParentToolWindow is null) return true;
BaseOperation.LayerIndexStart = ParentToolWindow.LayerRangeStart;
BaseOperation.LayerIndexEnd = ParentToolWindow.LayerRangeEnd;
- if (CanROI)
+ if (CanROI && BaseOperation.ROI.IsEmpty)
{
BaseOperation.ROI = Program.FrmMain.ROI;
}
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolMove.cs b/UVtools.GUI/Controls/Tools/CtrlToolMove.cs
index e9746e4..d4c96e4 100644
--- a/UVtools.GUI/Controls/Tools/CtrlToolMove.cs
+++ b/UVtools.GUI/Controls/Tools/CtrlToolMove.cs
@@ -17,6 +17,7 @@ namespace UVtools.GUI.Controls.Tools
{
public OperationMove Operation { get; }
+ private RadioButton[] radioButtons;
public CtrlToolMove()
{
@@ -28,6 +29,13 @@ namespace UVtools.GUI.Controls.Tools
(uint)Program.FrmMain.ActualLayerImage.Height);
SetOperation(Operation);
+ radioButtons = new[]
+ {
+ rbAnchorTopLeft, rbAnchorTopCenter, rbAnchorTopRight,
+ rbAnchorMiddleLeft, rbAnchorMiddleCenter, rbAnchorMiddleRight,
+ rbAnchorBottomLeft, rbAnchorBottomCenter, rbAnchorBottomRight
+ };
+
cbMoveType.SelectedIndex = 0;
ExtraActionCall(this);
}
@@ -70,12 +78,7 @@ namespace UVtools.GUI.Controls.Tools
{
base.UpdateOperation();
byte i = 0;
- foreach (var radioButton in new[]
- {
- rbAnchorTopLeft, rbAnchorTopCenter, rbAnchorTopRight,
- rbAnchorMiddleLeft, rbAnchorMiddleCenter, rbAnchorMiddleRight,
- rbAnchorBottomLeft, rbAnchorBottomCenter, rbAnchorBottomRight
- })
+ foreach (var radioButton in radioButtons)
{
if (radioButton.Checked)
{
@@ -91,6 +94,7 @@ namespace UVtools.GUI.Controls.Tools
Operation.MarginRight = (int)nmMarginRight.Value;
Operation.MarginBottom = (int)nmMarginBottom.Value;
Operation.IsCutMove = cbMoveType.SelectedIndex == 0;
+
return true;
}
}
diff --git a/UVtools.GUI/Properties/AssemblyInfo.cs b/UVtools.GUI/Properties/AssemblyInfo.cs
index 9bf24f4..442aef9 100644
--- a/UVtools.GUI/Properties/AssemblyInfo.cs
+++ b/UVtools.GUI/Properties/AssemblyInfo.cs
@@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.8.2.1")]
-[assembly: AssemblyFileVersion("0.8.2.1")]
+[assembly: AssemblyVersion("0.8.2.2")]
+[assembly: AssemblyFileVersion("0.8.2.2")]