From a50022c20da6ccf112a2a8851d87c8b6ed0d7f7d Mon Sep 17 00:00:00 2001 From: RKrom Date: Fri, 15 Jun 2012 07:04:51 +0000 Subject: [PATCH] Fixing Bug #3531460, forgot to convert the selected rectangle to screen coordinates. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1923 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Forms/AboutForm.cs | 2 +- Greenshot/Helpers/CaptureHelper.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Greenshot/Forms/AboutForm.cs b/Greenshot/Forms/AboutForm.cs index 512cfabbd..5bb2f3a30 100644 --- a/Greenshot/Forms/AboutForm.cs +++ b/Greenshot/Forms/AboutForm.cs @@ -72,7 +72,7 @@ namespace Greenshot { if (File.Exists( MainForm.LogFileLocation)) { System.Diagnostics.Process.Start("\"" + MainForm.LogFileLocation + "\""); } else { - MessageBox.Show("Greenshot can't write to logfile, otherwise it would be here: " + MainForm.LogFileLocation); + MessageBox.Show("Greenshot can't find the logfile, it should have been here: " + MainForm.LogFileLocation); } } catch (Exception) { MessageBox.Show("Couldn't open the greenshot.log, it's located here: " + MainForm.LogFileLocation, "Error opening greeenshot.log", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs index d220e7cff..953c8dcb9 100644 --- a/Greenshot/Helpers/CaptureHelper.cs +++ b/Greenshot/Helpers/CaptureHelper.cs @@ -784,8 +784,12 @@ namespace Greenshot.Helpers { } // Take the captureRect, this already is specified as bitmap coordinates capture.Crop(captureRect); - // save for re-capturing later and show recapture context menu option - RuntimeConfig.LastCapturedRegion = captureRect; + + // save for re-capturing later and show recapture context menu option + // Important here is that the location needs to be offsetted back to screen coordinates! + Rectangle tmpRectangle = captureRect.Clone(); + tmpRectangle.Offset(capture.ScreenBounds.Location.X, capture.ScreenBounds.Location.Y); + RuntimeConfig.LastCapturedRegion = tmpRectangle; HandleCapture(); } }