Added a fix for the cursor, it won't be on the surface if it's outside the captured range. This fixes the "issue" where the undo & delete buttons are active but nothing is visible.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2442 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-01-24 09:54:33 +00:00
commit fa091c0480

View file

@ -416,13 +416,19 @@ namespace Greenshot.Drawing {
/// </summary>
/// <param name="capture"></param>
public Surface(ICapture capture) : this(capture.Image) {
// check if cursor is captured, and visible
if (capture.Cursor != null && capture.CursorVisible) {
Rectangle cursorRect = new Rectangle(capture.CursorLocation, capture.Cursor.Size);
Rectangle captureRect = new Rectangle(Point.Empty, capture.Image.Size);
// check if cursor is on the capture, otherwise we leave it out.
if (cursorRect.IntersectsWith(captureRect)) {
cursorContainer = AddIconContainer(capture.Cursor, capture.CursorLocation.X, capture.CursorLocation.Y);
SelectElement(cursorContainer);
}
}
// Make sure the image is NOT disposed, we took the reference directly into ourselves
((Capture)capture).NullImage();
if (capture.Cursor != null && capture.CursorVisible) {
cursorContainer = AddIconContainer(capture.Cursor, capture.CursorLocation.X, capture.CursorLocation.Y);
SelectElement(cursorContainer);
}
captureDetails = capture.CaptureDetails;
}