[Jderobot-admin] jderobot-r1102 - trunk/src/testing/components/teleoperator

lr.morales en jderobot.org lr.morales en jderobot.org
Mar Nov 12 01:19:07 CET 2013


Author: lr.morales
Date: 2013-11-12 01:19:07 +0100 (Tue, 12 Nov 2013)
New Revision: 1102

Modified:
   trunk/src/testing/components/teleoperator/Gui.cpp
Log:
#114 Fixes graphical limit for motor controller	


Modified: trunk/src/testing/components/teleoperator/Gui.cpp
===================================================================
--- trunk/src/testing/components/teleoperator/Gui.cpp	2013-11-11 23:05:45 UTC (rev 1101)
+++ trunk/src/testing/components/teleoperator/Gui.cpp	2013-11-12 00:19:07 UTC (rev 1102)
@@ -354,6 +354,12 @@
     float event_y = event->button.y;
     static gboolean dragging = FALSE;
 
+    if(event_x < 0) event_x = 0;
+    if(event_y < 0) event_y = 0;
+
+    if(event_x > 200) event_x = 200;
+    if(event_y > 200) event_y = 200;
+
     switch (event->type) {
         case GDK_BUTTON_PRESS:
 
@@ -521,4 +527,4 @@
     while (gtkmain.events_pending()) {
         gtkmain.iteration(true);
     }
-}
\ No newline at end of file
+}



More information about the Jderobot-admin mailing list