# HG changeset patch # User Mike Miller # Date 1426437279 14400 # Node ID 4910b70d73284dd4388aec081ee4387b6257d57d # Parent f7a805f02723cf06e4dc4c6d2bd81645680bfbd7 Ensure correct coordinates are available in windowbuttondownfcn callback * __init_fltk__.cc (plot_window::handle): Ensure the "windowbuttondownfcn" callback is called after the axes property "currentpoint" is updated. diff -r f7a805f02723 -r 4910b70d7328 libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Sat Mar 14 18:54:23 2015 +0100 +++ b/libinterp/dldfcn/__init_fltk__.cc Sun Mar 15 12:34:39 2015 -0400 @@ -1466,16 +1466,21 @@ else fp.set_selectiontype ("normal"); - if (fp.get_windowbuttondownfcn ().is_defined ()) - fp.execute_windowbuttondownfcn (Fl::event_button ()); - gh = pixel2axes_or_ca (pos_x, pos_y); if (gh.ok ()) { ax_obj = gh_manager::get_object (gh); set_axes_currentpoint (ax_obj, pos_x, pos_y); + } + // Ensure windowbuttondownfcn is called after currentpoint + // is updated but before calling buttondownfcn. + if (fp.get_windowbuttondownfcn ().is_defined ()) + fp.execute_windowbuttondownfcn (Fl::event_button ()); + + if (gh.ok ()) + { int ndim = calc_dimensions (ax_obj); if (ndim == 3)