comparison src/DLD-FUNCTIONS/fltk_backend.cc @ 10593:26d51c6e1c4c

fixed fltk_backend bug when clicking on empty figure
author Shai Ayal <shaiay@users.sourceforge.net>
date Sat, 01 May 2010 00:05:46 +0300
parents a80207303549
children 91342260063e
comparison
equal deleted inserted replaced
10592:f0a7a72c1fbf 10593:26d51c6e1c4c
462 fp.set_currentpoint (pos); 462 fp.set_currentpoint (pos);
463 } 463 }
464 464
465 void set_axes_currentpoint (graphics_object ax, int px, int py) 465 void set_axes_currentpoint (graphics_object ax, int px, int py)
466 { 466 {
467 axes::properties& ap = 467 if (ax)
468 dynamic_cast<axes::properties&> (ax.get_properties ()); 468 {
469 axes::properties& ap =
470 dynamic_cast<axes::properties&> (ax.get_properties ());
469 471
470 double xx, yy; 472 double xx, yy;
471 pixel2pos (ax, px, py, xx, yy); 473 pixel2pos (ax, px, py, xx, yy);
472 474
473 Matrix pos (2,3,0); 475 Matrix pos (2,3,0);
474 pos(0,0) = xx; 476 pos(0,0) = xx;
475 pos(1,0) = yy; 477 pos(1,0) = yy;
476 pos(0,1) = xx; 478 pos(0,1) = xx;
477 pos(1,1) = yy; 479 pos(1,1) = yy;
478 480
479 ap.set_currentpoint (pos); 481 ap.set_currentpoint (pos);
482 }
480 } 483 }
481 484
482 int key2shift (int key) 485 int key2shift (int key)
483 { 486 {
484 if (key == FL_Shift_L || key == FL_Shift_R) 487 if (key == FL_Shift_L || key == FL_Shift_R)