changeset 18891:284f7fa221e9

Fix new x/y/zlabel position after deletion (bug #42652) * graphics.cc (axes::properties::remove_child): after deletion of labels, fix position of newly created ones.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 30 Jun 2014 22:34:07 +0200
parents f1e21a495e20
children 2420a4f22998
files libinterp/corefcn/graphics.cc
diffstat 1 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Thu Jul 03 09:09:48 2014 -0700
+++ b/libinterp/corefcn/graphics.cc	Mon Jun 30 22:34:07 2014 +0200
@@ -4931,13 +4931,25 @@
 axes::properties::remove_child (const graphics_handle& h)
 {
   if (xlabel.handle_value ().ok () && h == xlabel.handle_value ())
-    delete_text_child (xlabel);
+    {
+      delete_text_child (xlabel);
+      update_xlabel_position ();
+    }
   else if (ylabel.handle_value ().ok () && h == ylabel.handle_value ())
-    delete_text_child (ylabel);
+    {
+      delete_text_child (ylabel);
+      update_ylabel_position ();
+    }
   else if (zlabel.handle_value ().ok () && h == zlabel.handle_value ())
-    delete_text_child (zlabel);
+    {
+      delete_text_child (zlabel);
+      update_zlabel_position ();
+    }
   else if (title.handle_value ().ok () && h == title.handle_value ())
-    delete_text_child (title);
+    {
+      delete_text_child (title);
+      update_title_position ();
+    }
   else
     base_properties::remove_child (h);
 }