mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 08:32:07 +08:00
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:
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user