mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
Use existing value +/- correction to calculate new values for clip rectangle
This commit is contained in:
parent
245f6f261b
commit
dd21b1407d
1 changed files with 2763 additions and 2759 deletions
|
@ -1769,12 +1769,16 @@ namespace Greenshot.Editor.Drawing
|
|||
int verticalCorrection = targetClipRectangle.Top % (int) _zoomFactor.Numerator;
|
||||
if (horizontalCorrection != 0)
|
||||
{
|
||||
targetClipRectangle = targetClipRectangle.ChangeX(-horizontalCorrection).ChangeWidth(horizontalCorrection);
|
||||
targetClipRectangle = targetClipRectangle
|
||||
.ChangeX(targetClipRectangle.X - horizontalCorrection)
|
||||
.ChangeWidth(targetClipRectangle.Width + horizontalCorrection);
|
||||
}
|
||||
|
||||
if (verticalCorrection != 0)
|
||||
{
|
||||
targetClipRectangle = targetClipRectangle.ChangeY(-verticalCorrection).ChangeHeight(verticalCorrection);
|
||||
targetClipRectangle = targetClipRectangle
|
||||
.ChangeY(targetClipRectangle.Y - verticalCorrection)
|
||||
.ChangeHeight(targetClipRectangle.Height + verticalCorrection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue