projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes for xft when gc func not copy, fixes for zmpeg timestamp processing
[goodguy/history.git]
/
cinelerra-5.1
/
guicast
/
bcprogress.C
diff --git
a/cinelerra-5.1/guicast/bcprogress.C
b/cinelerra-5.1/guicast/bcprogress.C
index b2ba8cb474100d375aaaf7dae0c59d5b4ef34df8..92c3a222cc6e0f13c5e9bda9d911c9ef9b030f6b 100644
(file)
--- a/
cinelerra-5.1/guicast/bcprogress.C
+++ b/
cinelerra-5.1/guicast/bcprogress.C
@@
-113,9
+113,12
@@
int BC_ProgressBar::draw(int force, int flush)
if(do_text)
{
if(do_text)
{
+ float pos = position > length ? (float)1 :
+ length > 0 && position > 0 ? (float)position / length :
+ (float)0;
set_font(MEDIUMFONT);
set_color(get_resources()->progress_text); // draw decimal percentage
set_font(MEDIUMFONT);
set_color(get_resources()->progress_text); // draw decimal percentage
- sprintf(string, "%d%%", (int)(100 *
(float)position / length + 0.5 / w
));
+ sprintf(string, "%d%%", (int)(100 *
pos + 0.5f
));
draw_center_text(w / 2, h / 2 + get_text_ascent(MEDIUMFONT) / 2, string);
}
flash(flush);
draw_center_text(w / 2, h / 2 + get_text_ascent(MEDIUMFONT) / 2, string);
}
flash(flush);