comparison src/graphics.cc @ 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 1f429086565c
children 53f35799b235
comparison
equal deleted inserted replaced
8265:1c213dff76fc 8266:81b124f463f9
2021 2021
2022 if (xisnan (val.value ()) || is_handle (val)) 2022 if (xisnan (val.value ()) || is_handle (val))
2023 currentaxes = val; 2023 currentaxes = val;
2024 else 2024 else
2025 gripe_set_invalid ("currentaxes"); 2025 gripe_set_invalid ("currentaxes");
2026 }
2027
2028 void
2029 figure::properties::remove_child (const graphics_handle& gh)
2030 {
2031 base_properties::remove_child (gh);
2032
2033 if (gh == currentaxes.handle_value ())
2034 {
2035 graphics_handle new_currentaxes;
2036
2037 for (octave_idx_type i = 0; i < children.numel (); i++)
2038 {
2039 graphics_handle kid = children(i);
2040
2041 graphics_object go = gh_manager::get_object (kid);
2042
2043 if (go.isa ("axes"))
2044 {
2045 new_currentaxes = kid;
2046 break;
2047 }
2048 }
2049
2050 currentaxes = new_currentaxes;
2051 }
2026 } 2052 }
2027 2053
2028 void 2054 void
2029 figure::properties::set_visible (const octave_value& val) 2055 figure::properties::set_visible (const octave_value& val)
2030 { 2056 {