[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57552] Marker sizes in OpenGL printed plots a
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #57552] Marker sizes in OpenGL printed plots are larger than onscreen |
Date: |
Tue, 7 Jan 2020 18:56:05 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko |
URL:
<https://savannah.gnu.org/bugs/?57552>
Summary: Marker sizes in OpenGL printed plots are larger than
onscreen
Project: GNU Octave
Submitted by: rik5
Submitted on: Tue 07 Jan 2020 03:56:04 PM PST
Category: Plotting with OpenGL
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Inaccurate Result
Status: Confirmed
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
Code to reproduce
plot (1:10, 'o-')
print tst.png
By opening up the resulting tst.png and resizing the window to be the same as
the plot window that is already open in Octave one can see that the size of
the 'o' marker is larger in the plot.
This is likely due to the fact that Octave switched to measuring marker sizes
in points (1/72 of an inch) rather than pixels. In gl2ps-print.cc there is an
overloaded function set_linewidth which simply calls gl2psLineWidth(). It
would seem that we need something similar for the markers.
There is already an overload of init_markers in gl2ps-print.cc.
void init_marker (const std::string& m, double size, float width)
{
opengl_renderer::init_marker (m, size, width);
// FIXME: gl2ps can't handle closed contours and we set
linecap/linejoin
// round to obtain a better looking result for some markers.
if (m == "o" || m == "v" || m == "^" || m == ">" || m == "<" || m ==
"h"
|| m == "hexagram" || m == "p" || m == "pentagram")
{
set_linejoin ("round");
set_linecap ("round");
}
else
{
set_linejoin ("miter");
set_linecap ("square");
}
}
It calls the init_marker function in gl-render.cc which eventually calls
make_marker_list() and that function has
// FIXME: See bug #53056 (measure LineWidth in points).
const static double pts2pix
= (gh_mgr.get_object (0).get ("screenpixelsperinch").double_value ()
/ 72.0);
double sz = size * pts2pix;
For an average screen, "screenpixelsperinch" is ~96 so this piece of code
inflates the size by 4/3.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57552>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #57552] Marker sizes in OpenGL printed plots are larger than onscreen,
Rik <=