mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Fix for Best Fit on images bigger than 4 times the available space
This commit is contained in:
parent
1ef2df9602
commit
99742ad05a
1 changed files with 2 additions and 1 deletions
|
@ -1562,11 +1562,12 @@ namespace Greenshot {
|
|||
static bool isFit(int zoom, int source, int boundary)
|
||||
=> source * zoom / 100 <= boundary;
|
||||
|
||||
var nextValue = Array.FindLast(
|
||||
var nextIndex = Array.FindLastIndex(
|
||||
ZOOM_VALUES,
|
||||
zoom => isFit(zoom, imageSize.Width, maxImageSize.Width)
|
||||
&& isFit(zoom, imageSize.Height, maxImageSize.Height)
|
||||
);
|
||||
var nextValue = nextIndex < 0 ? ZOOM_VALUES[0] : ZOOM_VALUES[nextIndex];
|
||||
|
||||
ZoomSetValue(nextValue);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue