mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
Fixes Move and Pattern
* (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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
<RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl>
|
||||
<PackageProjectUrl>https://github.com/sn4k3/UVtools</PackageProjectUrl>
|
||||
<Description>MSLA/DLP, file analysis, repair, conversion and manipulation</Description>
|
||||
<Version>0.8.2.1</Version>
|
||||
<Version>0.8.2.2</Version>
|
||||
<Copyright>Copyright © 2020 PTRTECH</Copyright>
|
||||
<PackageIcon>UVtools.png</PackageIcon>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyVersion>0.8.2.1</AssemblyVersion>
|
||||
<FileVersion>0.8.2.1</FileVersion>
|
||||
<AssemblyVersion>0.8.2.2</AssemblyVersion>
|
||||
<FileVersion>0.8.2.2</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user