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



commit 8b4b9d396b60f023065d8ff0f548292c49f32f02
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]