From 53c361424ce89fb3426b67de6ee79eeee25f0765 Mon Sep 17 00:00:00 2001 From: JKlingen Date: Sun, 25 Nov 2012 20:04:58 +0000 Subject: [PATCH] fixed zoom position for multiscreen setup (however, some fixing has to be done for proper invalidation) git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2316 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Forms/CaptureForm.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Greenshot/Forms/CaptureForm.cs b/Greenshot/Forms/CaptureForm.cs index 37ec76fe6..20e1ae438 100644 --- a/Greenshot/Forms/CaptureForm.cs +++ b/Greenshot/Forms/CaptureForm.cs @@ -432,14 +432,14 @@ namespace Greenshot.Forms { } else { if (!conf.OptimizeForRDP) { if (verticalMove) { - Rectangle before = GuiRectangle.GetGuiRectangle(0, lastPos.Y - 2, this.Width+2, 45); - Rectangle after = GuiRectangle.GetGuiRectangle(0, cursorPosOnBitmap.Y - 2, this.Width+2, 45); + Rectangle before = GuiRectangle.GetGuiRectangle(WindowCapture.GetScreenBounds().Left, lastPos.Y - 2, this.Width+2, 45); + Rectangle after = GuiRectangle.GetGuiRectangle(WindowCapture.GetScreenBounds().Left, cursorPos.Y - 2, this.Width+2, 45); Invalidate(before); Invalidate(after); } if (horizontalMove) { - Rectangle before = GuiRectangle.GetGuiRectangle(lastPos.X - 2, 0, 75, this.Height+2); - Rectangle after = GuiRectangle.GetGuiRectangle(cursorPosOnBitmap.X -2, 0, 75, this.Height+2); + Rectangle before = GuiRectangle.GetGuiRectangle(lastPos.X - 2, WindowCapture.GetScreenBounds().Top, 75, this.Height+2); + Rectangle after = GuiRectangle.GetGuiRectangle(cursorPos.X -2, WindowCapture.GetScreenBounds().Top, 75, this.Height+2); Invalidate(before); Invalidate(after); } @@ -474,7 +474,7 @@ namespace Greenshot.Forms { Rectangle tr = new Rectangle(pos.X + distanceX, pos.Y - (distanceY + size.Height), size.Width, size.Height); Rectangle bl = new Rectangle(pos.X - (distanceX + size.Width), pos.Y + distanceY, size.Width, size.Height); Rectangle br = new Rectangle(pos.X + distanceX, pos.Y + distanceY, size.Width, size.Height); - Rectangle screenBounds = capture.ScreenBounds; + Rectangle screenBounds = Screen.GetBounds(pos); if (screenBounds.Contains(br)) { return br; } else if (screenBounds.Contains(bl)) { @@ -502,6 +502,8 @@ namespace Greenshot.Forms { graphics.CompositingQuality = CompositingQuality.HighSpeed; graphics.PixelOffsetMode = PixelOffsetMode.None; + destinationRectangle.Offset(-capture.ScreenBounds.Location.X, -capture.ScreenBounds.Location.Y); + using (GraphicsPath path = new GraphicsPath()) { path.AddEllipse(destinationRectangle); using (Region clipRegion = new Region(path)) { @@ -665,7 +667,7 @@ namespace Greenshot.Forms { const int zoomSourceHeight = 25; Rectangle sourceRectangle = new Rectangle(cursorPosOnBitmap.X - (zoomSourceWidth / 2), cursorPosOnBitmap.Y - (zoomSourceHeight / 2), zoomSourceWidth, zoomSourceHeight); - DrawZoom(graphics, sourceRectangle, ZoomArea(cursorPosOnBitmap, new Size(200, 200))); + DrawZoom(graphics, sourceRectangle, ZoomArea(cursorPos, new Size(200, 200))); } }