diff options
Diffstat (limited to 'src/Fl_Roller.cxx')
| -rw-r--r-- | src/Fl_Roller.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Fl_Roller.cxx b/src/Fl_Roller.cxx index 03e665314..15067191f 100644 --- a/src/Fl_Roller.cxx +++ b/src/Fl_Roller.cxx @@ -100,11 +100,13 @@ void Fl_Roller::draw() { int offset = step() ? int(value()/step()) : 0; const double ARC = 1.5; // 1/2 the number of radians visible const double delta = .2; // radians per knurl + int i; + double yy; if (horizontal()) { // horizontal one // draw shaded ends of wheel: int h1 = W/4+1; // distance from end that shading starts fl_color(color()); fl_rectf(X+h1,Y,W-2*h1,H); - for (int i=0; h1; i++) { + for (i =0; h1; i++) { fl_color((Fl_Color)(FL_GRAY-i-1)); int h2 = FL_GRAY-i-1 > FL_DARK3 ? 2*h1/3+1 : 0; fl_rectf(X+h2,Y,h1-h2,H); @@ -114,7 +116,7 @@ void Fl_Roller::draw() { if (active_r()) { // draw ridges: double junk; - for (double yy = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;; + for (yy = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;; yy += delta) { int yy1 = int((sin(yy)/sin(ARC)+1)*W/2); if (yy1 <= 0) continue; else if (yy1 >= W-1) break; @@ -138,7 +140,7 @@ void Fl_Roller::draw() { // draw shaded ends of wheel: int h1 = H/4+1; // distance from end that shading starts fl_color(color()); fl_rectf(X,Y+h1,W,H-2*h1); - for (int i=0; h1; i++) { + for (i =0; h1; i++) { fl_color((Fl_Color)(FL_GRAY-i-1)); int h2 = FL_GRAY-i-1 > FL_DARK3 ? 2*h1/3+1 : 0; fl_rectf(X,Y+h2,W,h1-h2); @@ -148,7 +150,7 @@ void Fl_Roller::draw() { if (active_r()) { // draw ridges: double junk; - for (double yy = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta; + for (yy = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta; ; yy += delta) { int yy1 = int((sin(yy)/sin(ARC)+1)*H/2); if (yy1 <= 0) continue; else if (yy1 >= H-1) break; |
