# HG changeset patch # User Andreas Weber # Date 1408398265 -7200 # Node ID c419e5487d0dfd6f714811d0d1fe8b4dd310410c # Parent 0ee9daa71273a454e65dbcb004d7b8a8477e50c1 Fix set_currentpoint in FLTK that figures units property is respected. * __init_fltk__.cc: Use map_from_boundingbox which respects the units figure property for set_currentpoint. * plot.txi: Document figure property currentpoint (not to be confused with axes property currentpoint) and units. diff -r 0ee9daa71273 -r c419e5487d0d doc/interpreter/plot.txi --- a/doc/interpreter/plot.txi Mon Aug 18 21:25:39 2014 +0200 +++ b/doc/interpreter/plot.txi Mon Aug 18 23:44:25 2014 +0200 @@ -1441,10 +1441,22 @@ @item currentobject @item currentpoint -Holds the coordinates of the point over which the mouse pointer was when -the mouse button was pressed. If a mouse callback function is defined, -@qcode{"currentpoint"} holds the coordinates of the point over which the -mouse pointer is when the function gets called. +An 1-by-2 matrix which holds the coordinates of the point over which +the mouse pointer was when a mouse event occurred. The x and y +coordinates are in units defined by the figures @qcode{"units"} property +and their origin is the lower left corner of the plotting area. + +Events which sets @qcode{"currentpoint"} are +@table @asis +@item A mouse button was pressed +always + +@item A mouse button was released +only if the figures callback @qcode{"windowbuttonupfcn"} is defined + +@item The pointer was moved while pressing mouse button (drag) +only if the figures callback @qcode{"windowbuttonmotionfcn"} is defined +@end table @item deletefcn @@ -1572,6 +1584,11 @@ @item type @item units +--- Values: @qcode{"inches"}, @qcode{"centimeters"}, @qcode{"normalized"}, +@qcode{"points"}, @qcode{"pixels"} [default], @qcode{"characters"}. + +Specifies the units which are used for @qcode{"position"}, +@qcode{"outerposition"} and @qcode{"currentpoint"}. @item userdata diff -r 0ee9daa71273 -r c419e5487d0d libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Mon Aug 18 21:25:39 2014 +0200 +++ b/libinterp/dldfcn/__init_fltk__.cc Mon Aug 18 23:44:25 2014 +0200 @@ -1134,10 +1134,7 @@ { if (!fp.is_beingdeleted ()) { - // FIXME: consider figures units property - Matrix pos (1,2,0); - pos(0) = px; - pos(1) = h () - (py + status_h + menu_dy ()); + Matrix pos = fp.map_from_boundingbox (px, py); fp.set_currentpoint (pos); graphics_object robj = gh_manager::get_object (fp.get_parent ()); root_figure::properties& rp =