screenshot-window-sizer: Remove superfluous check

We already filter out sizes that don't fit the screen when
building the scaledSizes array, no need to check again.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/232>
This commit is contained in:
Florian Müllner
2022-06-09 18:11:32 +02:00
parent 959782835d
commit faabfa11c2

View File

@@ -101,10 +101,6 @@ function cycleScreenshotSizes(display, window, binding) {
for (let i = 0; i < scaledSizes.length; i++) {
let [width, height] = scaledSizes[i];
// ignore sizes bigger than the workArea
if (width > workArea.width || height > workArea.height)
continue;
// get the best initial window size
let error = Math.abs(width - outerRect.width) + Math.abs(height - outerRect.height);
if (nearestIndex === undefined || error < nearestError) {