Mercurial > hg > octave-nkf
changeset 20821:395140e53656
Fix regression in svg output and simplify viewport handling (bug #44765)
* gl2ps-renderer.cc (glps-renderer::draw): remove check for GL2PS_NO_FEEDBACK, it it always true after EndViewport
* gl2ps-renderer.h (glps-renderer::draw_axes): call gl2psBegin(End)Viewport for every axes and check for GL2PS_NO_FEEDBACK after each axes.
* gl2ps-renderer.h (glps-renderer::draw_axes):remove unnecessary "naxes" attribute
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Mon, 12 Oct 2015 20:49:04 +0200 |
parents | 4e307c55a2b5 |
children | 01586012300e |
files | libinterp/corefcn/gl2ps-renderer.cc libinterp/corefcn/gl2ps-renderer.h |
diffstat | 2 files changed, 9 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-renderer.cc +++ b/libinterp/corefcn/gl2ps-renderer.cc @@ -137,17 +137,13 @@ opengl_renderer::draw (go); - // Without glFinish () there may primitives be missing in the + // Without glFinish () there may be primitives missing in the // gl2ps output. glFinish (); state = gl2psEndPage (); - if (state == GL2PS_NO_FEEDBACK) - { - warning ("gl2ps-renderer::draw: empty feedback buffer and/or nothing else to print"); - } - else if (state == GL2PS_ERROR) + if (state == GL2PS_ERROR) { old_print_cmd.clear (); error ("gl2ps-renderer::draw: gl2psEndPage returned GL2PS_ERROR");
--- a/libinterp/corefcn/gl2ps-renderer.h +++ b/libinterp/corefcn/gl2ps-renderer.h @@ -37,7 +37,7 @@ public: glps_renderer (FILE *_fp, const std::string& _term) : opengl_renderer () , fp (_fp), term (_term), fontsize (), - fontname (), naxes (0) { } + fontname () { } ~glps_renderer (void) { } @@ -53,12 +53,7 @@ void draw_axes (const axes::properties& props) { - // Finish previous sorting tree here, the last one will be closed - // by gl2psEndPage () - if (naxes++) - gl2psEndViewport (); - - // Initialize a sorting tree in gl2ps for each axes + // Initialize a sorting tree (viewport) in gl2ps for each axes GLint vp[4]; glGetIntegerv (GL_VIEWPORT, vp); gl2psBeginViewport (vp); @@ -67,6 +62,11 @@ // gl2ps output. opengl_renderer::draw_axes (props); glFinish (); + + // Finalize viewport + GLint state = gl2psEndViewport (); + if (state == GL2PS_NO_FEEDBACK) + warning ("gl2ps-renderer::draw: empty feedback buffer and/or nothing else to print"); } void draw_text (const text::properties& props); @@ -108,7 +108,6 @@ caseless_str term; double fontsize; std::string fontname; - int naxes; }; #endif // HAVE_GL2PS_H