[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51374] hidden axis causes warning by print()
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #51374] hidden axis causes warning by print() |
Date: |
Mon, 31 Jul 2017 20:47:39 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 |
Update of bug #51374 (project octave):
Status: None => Patch Submitted
Operating System: Microsoft Windows => Any
_______________________________________________________
Follow-up Comment #1:
@Pantxo: Could you take a look at this bug report?
The issue is in gl2ps_print.cc when the axes is not visible. I have two
different patches which both fix the issue, but maybe you know a reason to
prefer one over the other?
The first patch skips the entire draw_axes function when the axes is invisble.
This one is probably better for performance.
diff -r d9ca3f15f739 libinterp/corefcn/gl2ps-print.cc
--- a/libinterp/corefcn/gl2ps-print.cc Mon Jul 31 16:25:19 2017 -0700
+++ b/libinterp/corefcn/gl2ps-print.cc Mon Jul 31 17:43:58 2017 -0700
@@ -96,6 +96,9 @@ namespace octave
void draw_axes (const axes::properties& props)
{
+ if (! props.is_visible ())
+ return;
+
// Initialize a sorting tree (viewport) in gl2ps for each axes
GLint vp[4];
glGetIntegerv (GL_VIEWPORT, vp);
The second patch allows gl2ps to run through all the drawing routines, but
simply disables the warning.
diff -r d9ca3f15f739 libinterp/corefcn/gl2ps-print.cc
--- a/libinterp/corefcn/gl2ps-print.cc Mon Jul 31 16:25:19 2017 -0700
+++ b/libinterp/corefcn/gl2ps-print.cc Mon Jul 31 17:37:05 2017 -0700
@@ -107,7 +107,7 @@ namespace octave
// Finalize viewport
GLint state = gl2psEndViewport ();
- if (state == GL2PS_NO_FEEDBACK)
+ if (state == GL2PS_NO_FEEDBACK && props.is_visible ())
warning ("gl2ps_renderer::draw_axes: empty feedback buffer and/or
nothing else to print");
else if (state == GL2PS_ERROR)
error ("gl2ps_renderer::draw_axes: gl2psEndPage returned
GL2PS_ERROR");
Both patches are attached to the report if you want to try them out.
(file #41379, file #41380)
_______________________________________________________
Additional Item Attachment:
File name: print_warn1.diff Size:0 KB
File name: print_warn2.diff Size:0 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51374>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/