Skip to content

Commit cdd2f0b

Browse files
rbeallpeterbarker
authored andcommitted
horizon: fix resize freeze on Ubuntu
Avoids a potential resize loop as far as I can tell. Ubuntu and MacOS deal with DPI differently in the matplotlib library and I currently can only test MacOS Needs Testing!
1 parent 532c9e7 commit cdd2f0b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MAVProxy/modules/lib/wxhorizon_ui.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ def checkReszie(self):
166166
if not self.resized:
167167
oldypx = self.ypx
168168
oldxpx = self.xpx
169-
self.ypx = self.figure.get_size_inches()[1]*self.figure.dpi
170-
self.xpx = self.figure.get_size_inches()[0]*self.figure.dpi
169+
# use fixed DPI to match calcFontScaling()
170+
dpi = 100.0
171+
self.ypx = self.figure.get_size_inches()[1]*dpi
172+
self.xpx = self.figure.get_size_inches()[0]*dpi
171173
if (oldypx != self.ypx) or (oldxpx != self.xpx):
172174
self.resized = True
173175
else:

0 commit comments

Comments
 (0)