1
0
Fork 0
flightgear/PUI/puFrame.cxx

31 lines
793 B
C++
Raw Normal View History

1998-06-12 01:04:52 +00:00
#include "puLocal.h"
void puFrame::draw ( int dx, int dy )
{
if ( !visible ) return ;
abox . draw ( dx, dy, style, colour, FALSE ) ;
/* If greyed out then halve the opacity when drawing the label and legend */
if ( active )
glColor4fv ( colour [ PUCOL_LEGEND ] ) ;
else
glColor4f ( colour [ PUCOL_LEGEND ][0],
colour [ PUCOL_LEGEND ][1],
colour [ PUCOL_LEGEND ][2],
1998-06-17 21:32:42 +00:00
colour [ PUCOL_LEGEND ][3] / 2.0f ) ; /* 50% more transparent */
1998-06-12 01:04:52 +00:00
int xx = ( abox.max[0] - abox.min[0] - puGetStringWidth ( legendFont, legend ) ) / 2 ;
puDrawString ( legendFont, legend,
dx + abox.min[0] + xx,
dy + abox.min[1] + puGetStringDescender ( legendFont ) + PUSTR_BGAP ) ;
draw_label ( dx, dy ) ;
}