diff options
Diffstat (limited to 'UVtools.Core/Operations/Operation.cs')
-rw-r--r-- | UVtools.Core/Operations/Operation.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/UVtools.Core/Operations/Operation.cs b/UVtools.Core/Operations/Operation.cs index f8b9b10..acf78b2 100644 --- a/UVtools.Core/Operations/Operation.cs +++ b/UVtools.Core/Operations/Operation.cs @@ -383,6 +383,14 @@ namespace UVtools.Core.Operations ROI = roi; } + public Size GetRoiSizeOrDefault() => GetRoiSizeOrDefault(SlicerFile.Resolution); + public Size GetRoiSizeOrDefault(Mat defaultMat) => GetRoiSizeOrDefault(defaultMat.Size); + + public Size GetRoiSizeOrDefault(Size defaultSize) + { + return HaveROI && defaultSize != _roi.Size ? _roi.Size : defaultSize; + } + public Mat GetRoiOrDefault(Mat defaultMat) { return HaveROI && defaultMat.Size != _roi.Size ? new Mat(defaultMat, _roi) : defaultMat; |