[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53056] LineWidth interpreted as pixels, not p
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #53056] LineWidth interpreted as pixels, not points |
Date: |
Sun, 10 Feb 2019 23:51:43 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko |
Update of bug #53056 (project octave):
Status: In Progress => Patch Submitted
_______________________________________________________
Follow-up Comment #8:
@Pantxo: Could you review this patch? Conceptually, it is correct. In order
to change the LineWidth measured in points, to one measured in pixels for
glLineWidth, one only needs to multiply by a conversion factor. This
conversion factor is the monitor's pixels per inch divided by the factor 72
points/inch.
- m_glfcns.glLineWidth (w * m_devpixratio);
+ float points2pixels = toolkit.get_screen_resolution () / 72.0;
+ m_glfcns.glLineWidth (w * points2pixels * m_devpixratio);
The problem is that the code doesn't work because
toolkit.get_screen_resolution always returns 72. It is declared as a virtual
function graphics-toolkit.h and is meant to be overloaded by __init_fltk__,
__init_gnuplot__, or __init_qt__. Unfortunately, they don't seem to do that,
or they overload it by just returning the constant 72 without checking the
actual monitor resolution.
This information is, somehow, available because
get (0, 'screenpixelsperinch')
returns a value on my system which is close to 96. The root object's value is
initialized in graphics.cc by this function.
default_screenpixelsperinch (void)
{
return (octave::display_info::x_dpi () + octave::display_info::y_dpi ()) /
2;
}
Earlier I tested my patch by hardcoding the screen resolution at 96 so I know
that it is only get_screen_resolution which is not working.
(file #46232)
_______________________________________________________
Additional Item Attachment:
File name: bug53056.cset Size:1 KB
<https://savannah.gnu.org/file/bug53056.cset?file_id=46232>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?53056>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #53056] LineWidth interpreted as pixels, not points,
Rik <=