# HG changeset patch # User Konstantinos Poulios # Date 1291900627 -3600 # Branch disable-autopositioning # Node ID 80ad14c39c910bb5f80c30217c21e6bf98ecbaaf # Parent 7778f811473f3f4fd0401c04bb1d20f31a2c78ca Disable auto-positioning of manually positioned title and axes labels (second part). diff -r 7778f811473f -r 80ad14c39c91 src/ChangeLog --- a/src/ChangeLog Thu Dec 09 00:05:41 2010 +0100 +++ b/src/ChangeLog Thu Dec 09 14:17:07 2010 +0100 @@ -4,6 +4,9 @@ rotationmode, horizontalalignmentmode, verticalalignmentmode. * graphics.cc (axes::properties::init, axes::properties::set_defaults): Set mode to auto for all initialized positioning properties. + (axes::properties::set_xlabel,set_ylabel,set_zlabel,set_title): + Revert to auto-positioning mode and turn clipping off when title or + labels are set. * gl-render.cc (opengl_renderer::draw_axes): Disable auto-positioning of manually positioned title and axes labels. diff -r 7778f811473f -r 80ad14c39c91 src/gl-render.cc --- a/src/gl-render.cc Thu Dec 09 00:05:41 2010 +0100 +++ b/src/gl-render.cc Thu Dec 09 14:17:07 2010 +0100 @@ -1742,9 +1742,7 @@ text::properties& title_props = reinterpret_cast (gh_manager::get_object (props.get_title ()).get_properties ()); - // FIXME: auto-positioning should be disabled if the - // title has been positioned manually - if (! title_props.get_string ().empty ()) + if (! title_props.get_string ().empty () && title_props.positionmode_is("auto")) { Matrix bb = props.get_boundingbox (true); ColumnVector p = xform.untransform (bb(0)+bb(2)/2, (bb(1)-10), diff -r 7778f811473f -r 80ad14c39c91 src/graphics.cc --- a/src/graphics.cc Thu Dec 09 00:05:41 2010 +0100 +++ b/src/graphics.cc Thu Dec 09 14:17:07 2010 +0100 @@ -3294,24 +3294,45 @@ axes::properties::set_xlabel (const octave_value& v) { set_text_child (xlabel, "xlabel", v); + xset (xlabel.handle_value (), "positionmode", "auto"); + xset (xlabel.handle_value (), "rotationmode", "auto"); + xset (xlabel.handle_value (), "horizontalalignmentmode", "auto"); + xset (xlabel.handle_value (), "verticalalignmentmode", "auto"); + xset (xlabel.handle_value (), "clipping", "off"); } void axes::properties::set_ylabel (const octave_value& v) { set_text_child (ylabel, "ylabel", v); + xset (ylabel.handle_value (), "positionmode", "auto"); + xset (ylabel.handle_value (), "rotationmode", "auto"); + xset (ylabel.handle_value (), "horizontalalignmentmode", "auto"); + xset (ylabel.handle_value (), "verticalalignmentmode", "auto"); + xset (ylabel.handle_value (), "clipping", "off"); } void axes::properties::set_zlabel (const octave_value& v) { set_text_child (zlabel, "zlabel", v); + xset (zlabel.handle_value (), "positionmode", "auto"); + xset (zlabel.handle_value (), "rotationmode", "auto"); + xset (zlabel.handle_value (), "horizontalalignmentmode", "auto"); + xset (zlabel.handle_value (), "verticalalignmentmode", "auto"); + xset (zlabel.handle_value (), "clipping", "off"); } void axes::properties::set_title (const octave_value& v) { set_text_child (title, "title", v); + xset (title.handle_value (), "positionmode", "auto"); + xset (title.handle_value (), "horizontalalignment", "center"); + xset (title.handle_value (), "horizontalalignmentmode", "auto"); + xset (title.handle_value (), "verticalalignment", "bottom"); + xset (title.handle_value (), "verticalalignmentmode", "auto"); + xset (title.handle_value (), "clipping", "off"); } void