diff --git a/CHANGES b/CHANGES index a0d167d18..4b2cf9eb4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ CHANGES IN FLTK 1.1.8 + - Fl_Progress was using the wrong width to calculate + progress (STR #1492) - Documentation fixes (STR #1454, STR #1455, STR #1456, STR #1457, STR #1458, STR #1460, STR #1481) - Fl::x(), Fl::y(), Fl::w(), and Fl::h() did not report diff --git a/src/Fl_Progress.cxx b/src/Fl_Progress.cxx index 88a8ad773..69e76492c 100644 --- a/src/Fl_Progress.cxx +++ b/src/Fl_Progress.cxx @@ -67,7 +67,7 @@ void Fl_Progress::draw() // Draw the progress bar... if (maximum_ > minimum_) - progress = (int)(tw * (value_ - minimum_) / (maximum_ - minimum_) + 0.5f); + progress = (int)(w() * (value_ - minimum_) / (maximum_ - minimum_) + 0.5f); else progress = 0; @@ -83,12 +83,14 @@ void Fl_Progress::draw() labelcolor(c); - fl_clip(tx + progress, y(), w() - progress, h()); - draw_box(box(), x(), y(), w(), h(), active_r() ? color() : fl_inactive(color())); - draw_label(tx, y() + by, tw, h() - bh); - fl_pop_clip(); + if (progress