changeset 21643:9191c24fb329 stable

Fix autoscale affecting legend axes objects (bug #47765). * Canvas.cc (canvasMousePressEvent): Only set currentaxes object to a true axes object (not legend or colorbar). * __init_fltk__.cc (set_on_ax_obj): Only accept true axes objects. * __init_fltk__.cc (set_axes_currentpoint): Only set currentaxes object to a true axes.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 25 Apr 2016 08:04:18 -0700
parents cff44a19abfe
children 7bdfa98a98a3 7cb63f3994b0
files libgui/graphics/Canvas.cc libinterp/dldfcn/__init_fltk__.cc
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/Canvas.cc	Wed Apr 20 15:00:56 2016 -0400
+++ b/libgui/graphics/Canvas.cc	Mon Apr 25 08:04:18 2016 -0700
@@ -566,7 +566,9 @@
 
           if (axesObj)
             {
-              if (axesObj.get_properties ().handlevisibility_is ("on"))
+              if (axesObj.get_properties ().handlevisibility_is ("on")
+                  && axesObj.get_properties ().get_tag () != "legend"
+                  && axesObj.get_properties ().get_tag () != "colorbar")
                 Utils::properties<figure> (figObj)
                   .set_currentaxes (axesObj.get_handle ().as_octave_value ());
               if (! currentObj)
--- a/libinterp/dldfcn/__init_fltk__.cc	Wed Apr 20 15:00:56 2016 -0400
+++ b/libinterp/dldfcn/__init_fltk__.cc	Mon Apr 25 08:04:18 2016 -0700
@@ -1036,7 +1036,9 @@
   void set_on_ax_obj (const std::string& name, const std::string& value)
   {
     // ax_obj is the last clicked axes object
-    if (ax_obj && ax_obj.isa ("axes"))
+    if (ax_obj && ax_obj.isa ("axes")
+        && ax_obj.get_properties ().get_tag () != "legend"
+        && ax_obj.get_properties ().get_tag () != "colorbar")
       {
         axes::properties& ap =
           dynamic_cast<axes::properties&>(ax_obj.get_properties ());
@@ -1216,7 +1218,8 @@
         pos(1,2) = tmp(2);
 
         ap.set_currentpoint (pos);
-        fp.set_currentaxes (ap.get___myhandle__ ().value ());
+        if (ap.get_tag () != "legend" && ap.get_tag () != "colorbar")
+          fp.set_currentaxes (ap.get___myhandle__ ().value ());
       }
   }