Sfoglia il codice sorgente

wxGUI/nviz: fix failed map centring on mac with pre-wx4.1 (#895)

nilason 4 anni fa
parent
commit
4a972d07cb
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      gui/wxpython/nviz/mapwindow.py

+ 5 - 0
gui/wxpython/nviz/mapwindow.py

@@ -247,6 +247,11 @@ class GLWindow(MapWindowBase, glcanvas.GLCanvas):
                         "and restart GUI.")
             GMessage(message)
 
+    def GetContentScaleFactor(self):
+        if sys.platform == "darwin" and not CheckWxVersion(version=[4, 1, 0]):
+            return 1
+        return super().GetContentScaleFactor()
+
     def InitFly(self):
         """Initialize fly through dictionary"""
         fly = {'interval': 10,             # interval for timerFly