Minor cleanup.
This commit is contained in:
parent
becd8962eb
commit
481698caae
17
VU_Meter.C
17
VU_Meter.C
|
@ -50,34 +50,27 @@ VU_Meter::VU_Meter ( int X, int Y, int W, int H, const char *L ) :
|
||||||
void
|
void
|
||||||
VU_Meter::draw ( void )
|
VU_Meter::draw ( void )
|
||||||
{
|
{
|
||||||
int v;
|
|
||||||
|
|
||||||
v = (value() / maximum()) * _divisions;
|
|
||||||
|
|
||||||
draw_box( FL_FLAT_BOX, x(), y(), w(), h(), FL_BLACK );
|
draw_box( FL_FLAT_BOX, x(), y(), w(), h(), FL_BLACK );
|
||||||
|
|
||||||
|
int v = (value() / maximum()) * _divisions;
|
||||||
|
|
||||||
int bh = h() / _divisions;
|
int bh = h() / _divisions;
|
||||||
int bw = w() / _divisions;
|
int bw = w() / _divisions;
|
||||||
|
|
||||||
int b = 0;
|
|
||||||
|
|
||||||
for ( int p = _divisions; p > 0; p-- )
|
for ( int p = _divisions; p > 0; p-- )
|
||||||
{
|
{
|
||||||
Fl_Color c = fl_color_average( selection_color(), color(), (float)p / _divisions );
|
Fl_Color c = fl_color_average( selection_color(), color(), (float)p / _divisions );
|
||||||
|
|
||||||
if ( ! active_r() )
|
|
||||||
c = fl_inactive( c );
|
|
||||||
|
|
||||||
if ( p > v )
|
if ( p > v )
|
||||||
c = fl_color_average( FL_BLACK, c, _dim );
|
c = fl_color_average( FL_BLACK, c, _dim );
|
||||||
|
|
||||||
|
if ( ! active_r() )
|
||||||
|
c = fl_inactive( c );
|
||||||
|
|
||||||
if ( _type == FL_HORIZONTAL )
|
if ( _type == FL_HORIZONTAL )
|
||||||
draw_box( box(), x() + (p * bw), y(), bw, h(), c );
|
draw_box( box(), x() + (p * bw), y(), bw, h(), c );
|
||||||
else
|
else
|
||||||
draw_box( box(), x(), y() + h() - (p * bh), w(), bh, c );
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue