[gnome-shell/wip/carlosg/magnifier-improvements: 1/11] magnifier: Apply scale factor to crosshair length



commit 3cebd0bcb5db303e65a25b82689be04820ca79dd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Feb 6 10:31:17 2020 +0100

    magnifier: Apply scale factor to crosshair length
    
    On hidpi displays the length is double as advertised, make it match
    the advertised length.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/984

 js/ui/magnifier.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index d7d3506a57..af6c2567d6 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -430,8 +430,10 @@ var Magnifier = class Magnifier {
      *     lines making up the crosshairs.
      */
     setCrosshairsLength(length) {
-        if (this._crossHairs)
-            this._crossHairs.setLength(length);
+        if (this._crossHairs) {
+            let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
+            this._crossHairs.setLength(length / scaleFactor);
+        }
     }
 
     /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]