Revision: 6767
http://playerstage.svn.sourceforge.net/playerstage/?rev=6767&view=rev
Author: alexcb
Date: 2008-07-04 16:45:09 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
fixed robot dissapearing off screen while draging near edges bug
Modified Paths:
--------------
code/stage/trunk/libstage/canvas.cc
Modified: code/stage/trunk/libstage/canvas.cc
===================================================================
--- code/stage/trunk/libstage/canvas.cc 2008-07-04 23:33:05 UTC (rev 6766)
+++ code/stage/trunk/libstage/canvas.cc 2008-07-04 23:45:09 UTC (rev 6767)
@@ -197,6 +197,15 @@
void StgCanvas::CanvasToWorld( int px, int py,
double *wx, double *wy, double* wz )
{
+ if( px <= 0 )
+ px = 1;
+ else if( px >= w() )
+ px = w() - 1;
+ if( py <= 0 )
+ py = 1;
+ else if( py >= h() )
+ py = h() - 1;
+
int viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit