Author: manolo
Date: 2012-05-17 05:57:14 -0700 (Thu, 17 May 2012)
New Revision: 9512
Log:
Changed the type of the argument of fltk3::event_inside(const 
fltk3::Rectangle*) to 
fltk3::event_inside(const fltk3::Widget*) because a rectangle is not enough to 
specify
what the rectangle coordinates are relative to.

Modified:
   branches/branch-3.0/include/fltk3/run.h
   branches/branch-3.0/src/fltk3/run.cxx

Modified: branches/branch-3.0/include/fltk3/run.h
===================================================================
--- branches/branch-3.0/include/fltk3/run.h     2012-05-17 08:40:21 UTC (rev 
9511)
+++ branches/branch-3.0/include/fltk3/run.h     2012-05-17 12:57:14 UTC (rev 
9512)
@@ -698,7 +698,7 @@
   int compose(int &del);
   void compose_reset();
   int event_inside(int,int,int,int);
-  int event_inside(const fltk3::Rectangle*);
+  int event_inside(const fltk3::Widget*);
   int test_shortcut(fltk3::Shortcut);
   
   // event destinations:

Modified: branches/branch-3.0/src/fltk3/run.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/run.cxx       2012-05-17 08:40:21 UTC (rev 
9511)
+++ branches/branch-3.0/src/fltk3/run.cxx       2012-05-17 12:57:14 UTC (rev 
9512)
@@ -215,20 +215,20 @@
     \param[in] o       child widget to be tested
     \return            non-zero, if mouse event is inside the widget
 */
-int fltk3::event_inside(const fltk3::Rectangle *r) {
+int fltk3::event_inside(const fltk3::Widget *o) {
   // here r is relative to its enclosing group,
   // and e_x, e_y are relative to e_widget.
-  int dxr = e_x, dyr = e_y;
-  Group* g = ((Widget*)r)->parent();
+  int dx = e_x, dy = e_y;
+  Group* g = o->parent();
   if (e_widget && !e_widget->as_window()) {
-    dxr += e_widget->dx_window();
-    dyr += e_widget->dy_window();
+    dx += e_widget->dx_window();
+    dy += e_widget->dy_window();
   }
   if (g && !g->as_window()) {
-    dxr -= g->dx_window();
-    dyr -= g->dy_window();
+    dx -= g->dx_window();
+    dy -= g->dy_window();
     }
-  return ((Rectangle*)r)->contains(dxr, dyr);
+  return o->fltk3::Rectangle::contains(dx, dy);
 }
 
 //

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to