changeset 28401:80f873d55bff

maint: merge stable to default
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Thu, 04 Jun 2020 14:25:52 +0200
parents 287ffa8cfeae (current diff) 8ffe43de8bfe (diff)
children 09a3c0e91e6e
files libinterp/corefcn/gl-render.cc scripts/plot/appearance/legend.m
diffstat 2 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Tue Jun 02 22:47:07 2020 +0200
+++ b/libinterp/corefcn/gl-render.cc	Thu Jun 04 14:25:52 2020 +0200
@@ -3934,11 +3934,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;
--- a/scripts/plot/appearance/legend.m	Tue Jun 02 22:47:07 2020 +0200
+++ b/scripts/plot/appearance/legend.m	Thu Jun 04 14:25:52 2020 +0200
@@ -1284,11 +1284,11 @@
   endswitch
 endfunction
 
-function pos = boxposition (axpos, pbam, pba)
+function pos = boxposition (axpos, pba)
   pos = axpos;
   pbratio = pba(1)/pba(2);
   posratio = axpos(3)/axpos(4);
-  if (strcmp (pbam, "manual") && pbratio != posratio)
+  if (pbratio != posratio)
     if (posratio < pbratio)
       pos(4) = pos(3) / pbratio;
       pos(2) += (axpos(4) - pos(4)) / 2;
@@ -1352,7 +1352,7 @@
     [li, axpos, pbam, pba] = get (hax, {"looseinset", "position", ...
                                         "plotboxaspectratiomode", ...
                                         "plotboxaspectratio"}){:};
-    axpos = boxposition (axpos, pbam, pba);
+    axpos = boxposition (axpos, pba);
     lpos = [get(hl, "position")(1:2), sz];
 
     if (! outside)