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
This commit is contained in:
Matthias Melcher
2006-11-12 20:44:12 +00:00
parent 095ed29a7f
commit 725efb3569
2 changed files with 10 additions and 6 deletions
+2
View File
@@ -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
+8 -6
View File
@@ -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<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);
}
}