Mercurial > hg > octave-nkf
diff libinterp/corefcn/gl-render.cc @ 18822:e42843ceff48
Fix axes bounding box not obeying 'layer' property.
* gl-render.cc (draw_axes_boxes): Check layer2Dtop to decide which Z-value to
place axis at. In 2-D plot, don't draw box lines at second Z-value which
overlaps original axis and is always on top.
* graphics.cc (update_axes_layout): Set property is2D based on whether view()
elevation is 90 degrees.
* graphics.in.h (axes::properties): New is2D bool property.
* graphics.in.h (axes::properties::get_is2D): New getter function.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 23 Apr 2014 18:48:30 -0700 |
parents | 75ec138ba53b |
children | f684f7075aee |
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -873,6 +873,8 @@ opengl_renderer::draw_axes_boxes (const axes::properties& props) { bool xySym = props.get_xySym (); + bool layer2Dtop = props.get_layer2Dtop (); + bool is2d = props.get_is2D (); double xPlane = props.get_xPlane (); double yPlane = props.get_yPlane (); double zPlane = props.get_zPlane (); @@ -899,6 +901,10 @@ // X box set_color (props.get_xcolor_rgb ()); + + if (layer2Dtop) + std::swap (zpTick, zpTickN); + glVertex3d (xPlaneN, ypTick, zpTick); glVertex3d (xPlane, ypTick, zpTick); @@ -906,10 +912,13 @@ { glVertex3d (xPlaneN, ypTickN, zpTick); glVertex3d (xPlane, ypTickN, zpTick); - glVertex3d (xPlaneN, ypTickN, zpTickN); - glVertex3d (xPlane, ypTickN, zpTickN); - glVertex3d (xPlaneN, ypTick, zpTickN); - glVertex3d (xPlane, ypTick, zpTickN); + if (! is2d) + { + glVertex3d (xPlaneN, ypTickN, zpTickN); + glVertex3d (xPlane, ypTickN, zpTickN); + glVertex3d (xPlaneN, ypTick, zpTickN); + glVertex3d (xPlane, ypTick, zpTickN); + } } // Y box @@ -921,10 +930,14 @@ { glVertex3d (xpTickN, yPlaneN, zpTick); glVertex3d (xpTickN, yPlane, zpTick); - glVertex3d (xpTickN, yPlaneN, zpTickN); - glVertex3d (xpTickN, yPlane, zpTickN); - glVertex3d (xpTick, yPlaneN, zpTickN); - glVertex3d (xpTick, yPlane, zpTickN); + + if (! is2d) + { + glVertex3d (xpTickN, yPlaneN, zpTickN); + glVertex3d (xpTickN, yPlane, zpTickN); + glVertex3d (xpTick, yPlaneN, zpTickN); + glVertex3d (xpTick, yPlane, zpTickN); + } } // Z box