Mercurial > hg > octave-lojdl
changeset 8266:81b124f463f9
properly update currentaxes when axes are deleted
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Oct 2008 14:57:51 -0400 |
parents | 1c213dff76fc |
children | f2f1d07a7f0f |
files | src/ChangeLog src/graphics.cc src/graphics.h.in |
diffstat | 3 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2008-10-22 John W. Eaton <jwe@octave.org> + * graphics.cc (figure::properties::remove_child): New function. + * graphics.h.in: Provide decl. + * gl-render.cc (opengl_renderer::draw): Get all children. * DLD-FUNCTIONS/fltk_backend.cc (__fltk_redraw__):
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -2026,6 +2026,32 @@ } void +figure::properties::remove_child (const graphics_handle& gh) +{ + base_properties::remove_child (gh); + + if (gh == currentaxes.handle_value ()) + { + graphics_handle new_currentaxes; + + for (octave_idx_type i = 0; i < children.numel (); i++) + { + graphics_handle kid = children(i); + + graphics_object go = gh_manager::get_object (kid); + + if (go.isa ("axes")) + { + new_currentaxes = kid; + break; + } + } + + currentaxes = new_currentaxes; + } +} + +void figure::properties::set_visible (const octave_value& val) { std::string s = val.string_value ();