# HG changeset patch # User Shai Ayal # Date 1272661546 -10800 # Node ID 26d51c6e1c4c0a78fc5ae490acc1b03d4bfa7123 # Parent f0a7a72c1fbf9949e41488588ddd0d9e01f54506 fixed fltk_backend bug when clicking on empty figure diff -r f0a7a72c1fbf -r 26d51c6e1c4c src/ChangeLog --- a/src/ChangeLog Fri Apr 30 07:51:28 2010 -0400 +++ b/src/ChangeLog Sat May 01 00:05:46 2010 +0300 @@ -1,3 +1,8 @@ +2010-04-30 Shai Ayal + + * DLD-FUNCTIONS/fltk_backend.cc (plot_window::set_axes_currentpoint): + check for valid object before manipulating it + 2010-04-27 John W. Eaton * graphics.h.in (string_array_property::string_array_property): diff -r f0a7a72c1fbf -r 26d51c6e1c4c src/DLD-FUNCTIONS/fltk_backend.cc --- a/src/DLD-FUNCTIONS/fltk_backend.cc Fri Apr 30 07:51:28 2010 -0400 +++ b/src/DLD-FUNCTIONS/fltk_backend.cc Sat May 01 00:05:46 2010 +0300 @@ -464,19 +464,22 @@ void set_axes_currentpoint (graphics_object ax, int px, int py) { - axes::properties& ap = - dynamic_cast (ax.get_properties ()); + if (ax) + { + axes::properties& ap = + dynamic_cast (ax.get_properties ()); - double xx, yy; - pixel2pos (ax, px, py, xx, yy); + double xx, yy; + pixel2pos (ax, px, py, xx, yy); - Matrix pos (2,3,0); - pos(0,0) = xx; - pos(1,0) = yy; - pos(0,1) = xx; - pos(1,1) = yy; + Matrix pos (2,3,0); + pos(0,0) = xx; + pos(1,0) = yy; + pos(0,1) = xx; + pos(1,1) = yy; - ap.set_currentpoint (pos); + ap.set_currentpoint (pos); + } } int key2shift (int key)