From 4de8d0f8aa7f5cd22ae44a6ba7fb26e1150d5657 Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 28 Dec 2016 21:02:56 +0100 Subject: [PATCH] FEATURE-995: Added a check for the current mouse cursor location, to paste the image on that location. --- Greenshot/Drawing/Surface.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Greenshot/Drawing/Surface.cs b/Greenshot/Drawing/Surface.cs index b24f26dab..9dae14bc6 100644 --- a/Greenshot/Drawing/Surface.cs +++ b/Greenshot/Drawing/Surface.cs @@ -1715,6 +1715,7 @@ namespace Greenshot.Drawing } _cropContainer.Dispose(); _cropContainer = null; + break; } } } @@ -1726,7 +1727,7 @@ namespace Greenshot.Drawing { IDataObject clipboard = ClipboardHelper.GetDataObject(); - List formats = ClipboardHelper.GetFormats(clipboard); + var formats = ClipboardHelper.GetFormats(clipboard); if (formats == null || formats.Count == 0) { return; @@ -1817,6 +1818,15 @@ namespace Greenshot.Drawing { int x = 10; int y = 10; + + // FEATURE-995: Added a check for the current mouse cursor location, to paste the image on that location. + var mousePos = PointToClient(MousePosition); + if (Bounds.Contains(mousePos)) + { + x = mousePos.X; + y = mousePos.Y; + } + foreach (Image clipboardImage in ClipboardHelper.GetImages(clipboard)) { if (clipboardImage != null)