Revision: 6790
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6790&view=rev
Author:   alexcb
Date:     2008-07-07 14:43:54 -0700 (Mon, 07 Jul 2008)

Log Message:
-----------
fixed clock string background size

Modified Paths:
--------------
    code/stage/trunk/libstage/canvas.cc

Modified: code/stage/trunk/libstage/canvas.cc
===================================================================
--- code/stage/trunk/libstage/canvas.cc 2008-07-07 21:43:36 UTC (rev 6789)
+++ code/stage/trunk/libstage/canvas.cc 2008-07-07 21:43:54 UTC (rev 6790)
@@ -711,7 +711,7 @@
       glMatrixMode (GL_PROJECTION);
       glPushMatrix(); //save old projection
       glLoadIdentity ();
-      glOrtho( -w()/2.0, w()/2.0, -h()/2.0, h()/2.0, -100, 100 );      
+      glOrtho( 0, w(), 0, h(), -100, 100 );    
       glMatrixMode (GL_MODELVIEW);
 
       glPushMatrix();
@@ -724,16 +724,18 @@
 
                std::string clockstr = world->ClockString();
                if( showFollow == true && last_selection )
-                       clockstr.append( " --FOLLOW MODE--" );
+                       clockstr.append( " [ FOLLOW MODE ]" );
 
-               int width = clockstr.length() * 7;
+               int margin = 3;
+               int width = gl_width( clockstr.c_str() ) + 2 * margin;
+               int height = gl_height() + 2 * margin;
                
                colorstack.Push( 0.8,0.8,1.0 ); // pale blue
-               glRectf( -w()/2, -h()/2, -w()/2 + width, -h()/2+20 );
+               glRectf( 0, 0, width, height );
                colorstack.Pop();
                
       colorstack.Push( 0,0,0 ); // black
-      gl_draw_string( -w()/2+4, -h()/2+4, 5, clockstr.c_str() );
+      gl_draw_string( margin, margin, 5, clockstr.c_str() );
       colorstack.Pop();
 
       glEnable( GL_DEPTH_TEST );


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
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to