finally fixed last problems with position and invalidation of zoomer

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2317 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
JKlingen 2012-11-25 20:18:57 +00:00
commit 23f429d277

View file

@ -468,6 +468,7 @@ namespace Greenshot.Forms {
/// <param name="size"></param> /// <param name="size"></param>
/// <returns></returns> /// <returns></returns>
private Rectangle ZoomArea(Point pos, Size size) { private Rectangle ZoomArea(Point pos, Size size) {
Rectangle ret;
const int distanceX = 20; const int distanceX = 20;
const int distanceY = 20; const int distanceY = 20;
Rectangle tl = new Rectangle(pos.X - (distanceX + size.Width), pos.Y - (distanceY + size.Height), size.Width, size.Height); Rectangle tl = new Rectangle(pos.X - (distanceX + size.Width), pos.Y - (distanceY + size.Height), size.Width, size.Height);
@ -476,14 +477,16 @@ namespace Greenshot.Forms {
Rectangle br = new Rectangle(pos.X + distanceX, pos.Y + distanceY, size.Width, size.Height); Rectangle br = new Rectangle(pos.X + distanceX, pos.Y + distanceY, size.Width, size.Height);
Rectangle screenBounds = Screen.GetBounds(pos); Rectangle screenBounds = Screen.GetBounds(pos);
if (screenBounds.Contains(br)) { if (screenBounds.Contains(br)) {
return br; ret = br;
} else if (screenBounds.Contains(bl)) { } else if (screenBounds.Contains(bl)) {
return bl; ret = bl;
} else if (screenBounds.Contains(tr)) { } else if (screenBounds.Contains(tr)) {
return tr; ret = tr;
} else { } else {
return tl; ret = tl;
} }
ret.Offset(-capture.ScreenBounds.Location.X, -capture.ScreenBounds.Location.Y);
return ret;
} }
/// <summary> /// <summary>
@ -502,8 +505,6 @@ namespace Greenshot.Forms {
graphics.CompositingQuality = CompositingQuality.HighSpeed; graphics.CompositingQuality = CompositingQuality.HighSpeed;
graphics.PixelOffsetMode = PixelOffsetMode.None; graphics.PixelOffsetMode = PixelOffsetMode.None;
destinationRectangle.Offset(-capture.ScreenBounds.Location.X, -capture.ScreenBounds.Location.Y);
using (GraphicsPath path = new GraphicsPath()) { using (GraphicsPath path = new GraphicsPath()) {
path.AddEllipse(destinationRectangle); path.AddEllipse(destinationRectangle);
using (Region clipRegion = new Region(path)) { using (Region clipRegion = new Region(path)) {