# HG changeset patch # User Shai Ayal # Date 1205089418 -7200 # Node ID dfae35ac4fb03ff2a57ac48aab928acb8fb9c666 # Parent 09b1a9c8812850cd4ba12b1b52b7698697ed16b4 added zoomstack support to fltk_backend diff -r 09b1a9c88128 -r dfae35ac4fb0 src/graphics/ChangeLog --- a/src/graphics/ChangeLog Sun Mar 09 20:51:52 2008 +0200 +++ b/src/graphics/ChangeLog Sun Mar 09 21:03:38 2008 +0200 @@ -1,3 +1,8 @@ +2008-03-09 Shai Ayal + + * fltk_backend/fltk_backend.cc (plot_window::handle): add zoom + stack + 2008-03-06 Shai Ayal * fltk_backend/fltk_backend.cc (plot_window::handle): Add handling diff -r 09b1a9c88128 -r dfae35ac4fb0 src/graphics/fltk_backend/fltk_backend.cc --- a/src/graphics/fltk_backend/fltk_backend.cc Sun Mar 09 20:51:52 2008 +0200 +++ b/src/graphics/fltk_backend/fltk_backend.cc Sun Mar 09 21:03:38 2008 +0200 @@ -432,29 +432,29 @@ dynamic_cast (ax.get_properties ()); pixel2pos (px0, py0, x0, y0); pixel2pos (Fl::event_x (), Fl::event_y (), x1, y1); - Matrix pp (1,2,0); + Matrix xl (1,2,0); + Matrix yl (1,2,0); if (x0 < x1) { - pp(0) = x0; - pp(1) = x1; + xl(0) = x0; + xl(1) = x1; } else { - pp(0) = x1; - pp(1) = x0; + xl(0) = x1; + xl(1) = x0; } - ap.set_xlim (pp); if (y0 < y1) { - pp(0) = y0; - pp(1) = y1; + yl(0) = y0; + yl(1) = y1; } else { - pp(0) = y1; - pp(1) = y0; + yl(0) = y1; + yl(1) = y0; } - ap.set_ylim (pp); + ap.zoom (xl, yl); mark_modified (); } } @@ -469,7 +469,15 @@ } else if (Fl::event_button () == 3) { - axis_auto (); + graphics_object ax = + gh_manager::get_object (fp.get_currentaxes ()); + if (ax && ax.isa ("axes")) + { + axes::properties& ap = + dynamic_cast (ax.get_properties ()); + ap.unzoom (); + mark_modified (); + } } break; }