changeset 28399:2a0e566a03e1 stable

Don't scale text margin in printout (bug #58486) * gl-render.cc (opengl_renderer::draw_text_background): Use points_to_pixels rather than a fixed 4/3 ratio.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Tue, 02 Jun 2020 21:53:54 +0200
parents a379987a74b0
children 8ffe43de8bfe
files libinterp/corefcn/gl-render.cc
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Tue May 26 09:42:06 2020 +0200
+++ b/libinterp/corefcn/gl-render.cc	Tue Jun 02 21:53:54 2020 +0200
@@ -3822,11 +3822,7 @@
         && rotation != 180.0 && rotation != 270.0)
       m_glfcns.glRotated (-rotation, 0.0, 0.0, 1.0);
 
-    double m = props.get_margin ();
-    // FIXME: Margin property should be measured in points, not pixels.
-    //        On most screens the conversion factor is 4/3.
-    //        For HiDPI this will not work.
-    m *= 4.0/3.0;
+    double m = points_to_pixels (props.get_margin ());
     const Matrix bbox = props.get_extent_matrix ();
     double x0 = bbox (0) / m_devpixratio - m;
     double x1 = x0 + bbox(2) / m_devpixratio + 2 * m;