[Plib-cvs] plib/src/pui puButton.cxx,1.20,1.21
Brought to you by:
sjbaker
From: Norman V. <nh...@us...> - 2003-02-07 17:41:11
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1:/tmp/cvs-serv20522 Modified Files: puButton.cxx Log Message: from John Fay - Fix a highlighting/lowlighting problem and remove a couple of compiler warnings. Index: puButton.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puButton.cxx,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- puButton.cxx 2 Sep 2002 06:05:45 -0000 1.20 +++ puButton.cxx 7 Feb 2003 17:41:07 -0000 1.21 @@ -115,8 +115,8 @@ glBegin ( GL_POLYGON ) ; for ( theta = -SG_PI ; theta <= SG_PI ; theta += dtheta ) - glVertex2f ( dx + abox.min[0] + rad + (rad * cos ( theta )), - dy + abox.min[1] + rad + (rad * sin ( theta )) ) ; + glVertex2f ( dx + abox.min[0] + rad + (rad * float(cos ( theta ))), + dy + abox.min[1] + rad + (rad * float(sin ( theta ))) ) ; glEnd () ; if ( getIntegerValue () ^ highlighted ) @@ -137,8 +137,8 @@ glBegin ( GL_POLYGON ) ; for ( theta = -SG_PI ; theta <= SG_PI ; theta += dtheta ) - glVertex2f ( dx + abox.min[0] + rad*2 + (rad * cos ( theta )), - dy + abox.min[1] + rad*2 + (rad * sin ( theta )) ) ; + glVertex2f ( dx + abox.min[0] + rad*2 + (rad * float(cos ( theta ))), + dy + abox.min[1] + rad*2 + (rad * float(sin ( theta ))) ) ; glEnd () ; } @@ -220,7 +220,13 @@ invokeCallback () ; } else - highlight () ; + { + /* If the mouse is over the widget, highlight it; otherwise lowlight it */ + if ( ( abox.min[0] <= x ) && ( abox.max[0] >= x ) && ( abox.min[1] <= y ) && ( abox.max[1] >= y ) ) + highlight () ; + else + lowlight () ; + } } else lowlight () ; |