Skip to content

Conversation

@rbeall
Copy link
Contributor

@rbeall rbeall commented Dec 6, 2025

PR Description:
Recent matplotlib versions (3.5+) report the actual display DPI on HiDPI/Retina screens. The font scaling in calcFontScaling() multiplies by figure.dpi, which now returns ~200 on Retina displays instead of the expected 100, causing all text to render at 2x size.

Fix by using a fixed reference DPI of 100 for the font calculations.

How Tested:

  • macOS 14.x with Retina display
  • matplotlib 3.10.7
  • Verified text renders at expected size before/after fix
  • Confirmed window resizing still works correctly

@rbeall
Copy link
Contributor Author

rbeall commented Dec 6, 2025

I don't have a non Mac/Retina setup to test this on at the moment to make sure that it doesn't have detrimental affects on other machines, but it does fix it on Mac.

@peterbarker
Copy link
Contributor

This causes the display to utterly freeze on Ubuntu when I resize it.

It does do nice things to the font scaling, 'though :-)

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!
Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I don't really like this. Pretty sure there's got to be a better way to do things than use a fixed value - something else has to be going wrong here somewhere.

But it does fix the display for me, and it's a problem for @rbeall , so it'll do for now.

Merging, thanks!

@peterbarker peterbarker merged commit cdd2f0b into ArduPilot:master Dec 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants