# HG changeset patch # User Pantxo Diribarne # Date 1461596658 25200 # Node ID 9191c24fb329186585e30272ccc302a084c02c1a # Parent cff44a19abfecebf8d3e181dcaf060ca445a1bc4 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. diff -r cff44a19abfe -r 9191c24fb329 libgui/graphics/Canvas.cc --- 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
(figObj) .set_currentaxes (axesObj.get_handle ().as_octave_value ()); if (! currentObj) diff -r cff44a19abfe -r 9191c24fb329 libinterp/dldfcn/__init_fltk__.cc --- 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(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 ()); } }