[gnome-shell] magnifier: Simplify some code
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] magnifier: Simplify some code
- Date: Mon, 16 Sep 2019 20:40:19 +0000 (UTC)
commit 2546445884d7c01a35775df5b7e22de6f07a176d
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Aug 20 04:10:46 2019 +0200
magnifier: Simplify some code
We don't need nested if blocks to set or unset the crosshairs'
clip size.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731
js/ui/magnifier.js | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 9d3ad6473c..73522586f3 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -451,15 +451,11 @@ var Magnifier = class Magnifier {
* @clip: Flag to indicate whether to clip the crosshairs.
*/
setCrosshairsClip(clip) {
- if (clip) {
- if (this._crossHairs)
- this._crossHairs.setClip(CROSSHAIRS_CLIP_SIZE);
- } else {
- // Setting no clipping on crosshairs means a zero sized clip
- // rectangle.
- if (this._crossHairs)
- this._crossHairs.setClip([0, 0]);
- }
+ if (!this._crossHairs)
+ return;
+
+ // Setting no clipping on crosshairs means a zero sized clip rectangle.
+ this._crossHairs.setClip(clip ? CROSSHAIRS_CLIP_SIZE : [0, 0]);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]