From 79ea558dbbdede0d1fcd5a1f2a7520d8d800648b Mon Sep 17 00:00:00 2001 From: Killy Date: Sat, 2 May 2020 01:52:05 +0300 Subject: [PATCH] Fix: zoom-in when selection is out of sight --- Greenshot/Forms/ImageEditorForm.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index 8bf59df27..d397b8bc8 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -1590,10 +1590,11 @@ namespace Greenshot { var size = surface.Size; if (value > Surface.ZoomFactor) // being smart on zoom-in { - var sel = surface.GetSelectionRectangle(); - if (sel != Rectangle.Empty) + var selection = surface.GetSelectionRectangle(); + selection.Intersect(rc); + if (selection != Rectangle.Empty) { - rc.Intersect(sel); // zoom to visible part of selection + rc = selection; // zoom to visible part of selection } else {