]> git.mxchange.org Git - simgear.git/blob - PUI/puFrame.cxx
Added the Serial subdirectory
[simgear.git] / PUI / puFrame.cxx
1
2
3 #include "puLocal.h"
4
5 void puFrame::draw ( int dx, int dy )
6 {
7   if ( !visible ) return ;
8
9   abox . draw ( dx, dy, style, colour, FALSE ) ;
10
11   /* If greyed out then halve the opacity when drawing the label and legend */
12
13   if ( active )
14     glColor4fv ( colour [ PUCOL_LEGEND ] ) ;
15   else
16     glColor4f ( colour [ PUCOL_LEGEND ][0],
17                 colour [ PUCOL_LEGEND ][1],
18                 colour [ PUCOL_LEGEND ][2],
19                 colour [ PUCOL_LEGEND ][3] / 2.0f ) ; /* 50% more transparent */
20
21   int xx = ( abox.max[0] - abox.min[0] - puGetStringWidth ( legendFont, legend ) ) / 2 ;
22
23   puDrawString ( legendFont, legend,
24                   dx + abox.min[0] + xx,
25                   dy + abox.min[1] + puGetStringDescender ( legendFont ) + PUSTR_BGAP ) ;
26
27   draw_label ( dx, dy ) ;
28 }
29
30