Browse Source

STR #1492: Fl_Progress was using the wrong width to calculate progress

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5540 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
pull/168/head
Matthias Melcher 19 years ago
parent
commit
725efb3569
  1. 2
      CHANGES
  2. 14
      src/Fl_Progress.cxx

2
CHANGES

@ -1,5 +1,7 @@ @@ -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

14
src/Fl_Progress.cxx

@ -67,7 +67,7 @@ void Fl_Progress::draw() @@ -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() @@ -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<w()) {
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();
}
} else {
draw_box(box(), x(), y(), w(), h(), color());
draw_box(box(), x(), y(), w(), h(), active_r() ? color() : fl_inactive(color()));
draw_label(tx, y() + by, tw, h() - bh);
}
}

Loading…
Cancel
Save