diff libgui/graphics/Figure.cc @ 33376:a8ce25c80695 stable

Correctly scale figure position on screen with DPI scaling. * libgui/graphics/Figure.cc (Figure::Figure): Set device pixel ratio (> 1 for high DPI screens) early on in constructor of Figure. * libinterp/corefcn/graphics.cc (figure::properties::get_boundingbox, figure::properties::bbox2position): Respect device pixel ratio in conversion of "position" property to Qt screen pixel coordinates. See: https://octave.discourse.group/t/5466
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 06 Apr 2024 14:43:10 +0200
parents 2e484f9f1f18
children d7e4a4e1a8fb
line wrap: on
line diff
--- a/libgui/graphics/Figure.cc	Mon Apr 08 17:08:51 2024 +0200
+++ b/libgui/graphics/Figure.cc	Sat Apr 06 14:43:10 2024 +0200
@@ -130,6 +130,8 @@
 
   figure::properties& fp = properties<figure> ();
 
+  fp.set___device_pixel_ratio__ (win->devicePixelRatio ());
+
   // Adjust figure position
   m_innerRect = boundingBoxToRect (fp.get_boundingbox (true));
   m_outerRect = boundingBoxToRect (fp.get_boundingbox (false));