Minor cleanup.

This commit is contained in:
Jonathan Moore Liles 2008-03-11 20:40:24 -05:00
parent becd8962eb
commit 481698caae
1 changed files with 5 additions and 12 deletions

View File

@ -50,34 +50,27 @@ VU_Meter::VU_Meter ( int X, int Y, int W, int H, const char *L ) :
void
VU_Meter::draw ( void )
{
int v;
v = (value() / maximum()) * _divisions;
draw_box( FL_FLAT_BOX, x(), y(), w(), h(), FL_BLACK );
int v = (value() / maximum()) * _divisions;
int bh = h() / _divisions;
int bw = w() / _divisions;
int b = 0;
for ( int p = _divisions; p > 0; p-- )
{
Fl_Color c = fl_color_average( selection_color(), color(), (float)p / _divisions );
if ( ! active_r() )
c = fl_inactive( c );
if ( p > v )
c = fl_color_average( FL_BLACK, c, _dim );
if ( ! active_r() )
c = fl_inactive( c );
if ( _type == FL_HORIZONTAL )
draw_box( box(), x() + (p * bw), y(), bw, h(), c );
else
draw_box( box(), x(), y() + h() - (p * bh), w(), bh, c );
}
// we don't care about the label
// draw_label (tx, y() + by, tw, h() - bh);
}