screenshot-window-sizer: Handle wrapping around backwards
The mod takes care of wrapping at the top, but not when
decrementing 0. Fix this by using Array.prototype.at(),
which handles negative indexes.
Close https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/467
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/284>
(cherry picked from commit dd8ee2931a)
This commit is contained in:
@@ -96,7 +96,7 @@ export default class ScreenshotWindowSizerExtension extends Extension {
|
||||
|
||||
// get the next size up or down from ideal
|
||||
let newIndex = (nearestIndex + (backwards ? -1 : 1)) % scaledSizes.length;
|
||||
let [newWidth, newHeight] = scaledSizes[newIndex];
|
||||
let [newWidth, newHeight] = scaledSizes.at(newIndex);
|
||||
|
||||
// Push the window onscreen if it would be resized offscreen
|
||||
let newX = outerRect.x;
|
||||
|
||||
Reference in New Issue
Block a user