"fixed" that the ellipse of the zoom region didn't match the destination rectangle. It's not perfect yet, as the upper side is 91px, the lower side 92px... but this might be a problem with the pen, which draws a 9px thick line... to be continued.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2325 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-28 17:15:55 +00:00
commit 219fd48453

View file

@ -516,8 +516,9 @@ namespace Greenshot.Forms {
graphics.CompositingQuality = CompositingQuality.HighSpeed; graphics.CompositingQuality = CompositingQuality.HighSpeed;
graphics.PixelOffsetMode = PixelOffsetMode.None; graphics.PixelOffsetMode = PixelOffsetMode.None;
int pixelThickness = destinationRectangle.Width / sourceRectangle.Width;
using (GraphicsPath path = new GraphicsPath()) { using (GraphicsPath path = new GraphicsPath()) {
path.AddEllipse(destinationRectangle); path.AddEllipse(new Rectangle(destinationRectangle.Location, new Size(destinationRectangle.Width - pixelThickness, destinationRectangle.Height - pixelThickness)));
using (Region clipRegion = new Region(path)) { using (Region clipRegion = new Region(path)) {
graphics.Clip = clipRegion; graphics.Clip = clipRegion;
graphics.FillRectangle(backgroundBrush,destinationRectangle); graphics.FillRectangle(backgroundBrush,destinationRectangle);
@ -525,7 +526,6 @@ namespace Greenshot.Forms {
} }
} }
int pixelThickness = destinationRectangle.Width / sourceRectangle.Width;
using (Pen pen = new Pen(Color.Black, pixelThickness)) { using (Pen pen = new Pen(Color.Black, pixelThickness)) {
int halfWidth = (destinationRectangle.Width >> 1) - (pixelThickness >> 1); int halfWidth = (destinationRectangle.Width >> 1) - (pixelThickness >> 1);
int halfWidthEnd = (destinationRectangle.Width >> 1) - pixelThickness; int halfWidthEnd = (destinationRectangle.Width >> 1) - pixelThickness;