mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
"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:
parent
4de7c0812f
commit
219fd48453
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue