magnifier: Small cleanup
Use an early return instead of a big if() block to cut down on indentation. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1932>
This commit is contained in:
parent
77b175e763
commit
8f42053b5f
@ -232,20 +232,21 @@ var Magnifier = class Magnifier {
|
|||||||
scrollToMousePos(...args) {
|
scrollToMousePos(...args) {
|
||||||
const [xMouse, yMouse] = args.length ? args : global.get_pointer();
|
const [xMouse, yMouse] = args.length ? args : global.get_pointer();
|
||||||
|
|
||||||
if (xMouse != this.xMouse || yMouse != this.yMouse) {
|
if (xMouse === this.xMouse && yMouse === this.yMouse)
|
||||||
this.xMouse = xMouse;
|
return;
|
||||||
this.yMouse = yMouse;
|
|
||||||
|
|
||||||
let sysMouseOverAny = false;
|
this.xMouse = xMouse;
|
||||||
this._zoomRegions.forEach(zoomRegion => {
|
this.yMouse = yMouse;
|
||||||
if (zoomRegion.scrollToMousePos())
|
|
||||||
sysMouseOverAny = true;
|
let sysMouseOverAny = false;
|
||||||
});
|
this._zoomRegions.forEach(zoomRegion => {
|
||||||
if (sysMouseOverAny)
|
if (zoomRegion.scrollToMousePos())
|
||||||
this.hideSystemCursor();
|
sysMouseOverAny = true;
|
||||||
else
|
});
|
||||||
this.showSystemCursor();
|
if (sysMouseOverAny)
|
||||||
}
|
this.hideSystemCursor();
|
||||||
|
else
|
||||||
|
this.showSystemCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user