Mercurial > octave
changeset 24689:800876b7132c
Make some markers linejoin/linecap round for better looking printout (bug #53023)
* gl2ps-print.cc (gl2ps_renderer::init_marker): reimplement method to change
linecap and linejoin on a per marker basis.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Mon, 05 Feb 2018 16:29:49 +0100 |
parents | dd68506c0926 |
children | 2ce26c4cb323 |
files | libinterp/corefcn/gl2ps-print.cc |
diffstat | 1 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc Mon Feb 05 22:14:34 2018 +0100 +++ b/libinterp/corefcn/gl2ps-print.cc Mon Feb 05 16:29:49 2018 +0100 @@ -177,6 +177,25 @@ void draw_pixels (int w, int h, const uint8_t *data); void draw_pixels (int w, int h, const uint16_t *data); + 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"); + } + } + void set_linestyle (const std::string& s, bool use_stipple = false, double linewidth = 0.5) {