Fix issue where uneven size are calculated, this way we always have a plural of 4.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2350 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-12-03 21:11:35 +00:00
commit d63c3806aa

View file

@ -485,7 +485,6 @@ namespace Greenshot.Forms {
Rectangle after = GuiRectangle.GetGuiRectangle(cursorPos.X -2, allScreenBounds.Top, 75, this.Height+2); Rectangle after = GuiRectangle.GetGuiRectangle(cursorPos.X -2, allScreenBounds.Top, 75, this.Height+2);
Invalidate(before); Invalidate(before);
Invalidate(after); Invalidate(after);
LOG.Info(after);
} }
} }
@ -519,6 +518,8 @@ namespace Greenshot.Forms {
// convert to be relative to top left corner of all screen bounds // convert to be relative to top left corner of all screen bounds
screenBounds.Location = WindowCapture.GetLocationRelativeToScreenBounds(screenBounds.Location); screenBounds.Location = WindowCapture.GetLocationRelativeToScreenBounds(screenBounds.Location);
int relativeZoomSize = Math.Min(screenBounds.Width, screenBounds.Height) / 5; int relativeZoomSize = Math.Min(screenBounds.Width, screenBounds.Height) / 5;
// Make sure the final size is a plural of 4, this makes it look better
relativeZoomSize = relativeZoomSize - (relativeZoomSize % 4);
Size zoomSize = new Size(relativeZoomSize, relativeZoomSize); Size zoomSize = new Size(relativeZoomSize, relativeZoomSize);
Point zoomOffset = new Point(20, 20); Point zoomOffset = new Point(20, 20);