octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49053] figure scaling issue with Qt 5 on macO


From: Rik
Subject: [Octave-bug-tracker] [bug #49053] figure scaling issue with Qt 5 on macOS with Retina / HiDPI scaling
Date: Wed, 24 Jan 2018 16:14:05 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #86, bug #49053 (project octave):

Good news is that I tested this on a Linux machine and the HiDPI issues
mentioned here are resolved (for qt toolkit anyways).

I'm uploading an updated version of the patch.  I wrapped all lines to less
than 80 characters.  In addition there were other small tweaks.  Octave
prefers to keep the header files alphabetized when possible.  Also I modified
the indent to more clearly show what is being rounded.  See below 


-    vw[2] = octave::math::round (screen_scale_inverse *
-      static_cast<float> (vw[2]));
-    vw[3] = octave::math::round (screen_scale_inverse *
-      static_cast<float> (vw[3]));
-    glOrtho (0, vw[2], vw[3], 0, xZ1, xZ2);    
+    vw[2] = octave::math::round (screen_scale_inverse
+                                 * static_cast<float> (vw[2]));
+    vw[3] = octave::math::round (screen_scale_inverse
+                                 * static_cast<float> (vw[3]));
+    glOrtho (0, vw[2], vw[3], 0, xZ1, xZ2);


This is a big step in the right direction, but still not quite ready to be
checked in.  Currently on-screen display is accurate, but printing does not
work.  Presumably some scaling also needs to happen in gl2ps-print.cc.

The second major task is to go through each graphic primitive and make sure
that it works with HiDPI.  This means figure, axes, line, image, patch,
surface, text, light, and hggroup.  For extra credit we could test some of the
uiXXX functions as well.

For line objects, it appears that there needs to be a scaling factor in the
linewidth.

For text objects there is a problem calculating extents.  You can see this
with 'demo legend 2', but a more direct test is


close all
ht = text (0.5, 0.5, "Hello World", "backgroundcolor", "r")


For me the extent of the red background layer is much larger than the actual
text size.

Offhand, I think image and surface are probably fine.  I ran 'demo light' and
didn't see too much weirdness.  hggroup really is only for grouping things so
shouldn't be a problem either.


(file #43070)
    _______________________________________________________

Additional Item Attachment:

File name: hidpi.20180124.cset            Size:11 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49053>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]