projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
batchrender hang on close, apply pref saves defaults, overwrite/splice tweaks, specif...
[goodguy/history.git]
/
cinelerra-5.1
/
guicast
/
bcpot.C
diff --git
a/cinelerra-5.1/guicast/bcpot.C
b/cinelerra-5.1/guicast/bcpot.C
index d9cb1594db9559cc9d49800630945d7ca7d6d123..60807911b501ed6e628f6d3bb8a2046e40db43a6 100644
(file)
--- a/
cinelerra-5.1/guicast/bcpot.C
+++ b/
cinelerra-5.1/guicast/bcpot.C
@@
-21,7
+21,7
@@
#include "bcpot.h"
#include "bcresources.h"
#include "bcpot.h"
#include "bcresources.h"
-#include "colors.h"
+#include "
bc
colors.h"
#include "keys.h"
#include "units.h"
#include "vframe.h"
#include "keys.h"
#include "units.h"
#include "vframe.h"
@@
-247,7
+247,6
@@
int BC_Pot::repeat_event(int64_t duration)
}
else
show_tooltip();
}
else
show_tooltip();
- tooltip_done = 1;
}
return 1;
}
}
return 1;
}
@@
-291,7
+290,6
@@
int BC_Pot::cursor_enter_event()
{
if(top_level->event_win == win && enabled)
{
{
if(top_level->event_win == win && enabled)
{
- tooltip_done = 0;
if(!top_level->button_down && status == POT_UP)
{
status = POT_HIGH;
if(!top_level->button_down && status == POT_UP)
{
status = POT_HIGH;
@@
-462,7
+460,8
@@
const char* BC_FPot::get_caption()
float BC_FPot::get_percentage()
{
float BC_FPot::get_percentage()
{
- return (value - minvalue) / (maxvalue - minvalue);
+ float range = maxvalue - minvalue;
+ return range > 0 ? (value - minvalue) / range : minvalue;
}
int BC_FPot::percentage_to_value(float percentage)
}
int BC_FPot::percentage_to_value(float percentage)
@@
-551,7
+550,8
@@
const char* BC_IPot::get_caption()
float BC_IPot::get_percentage()
{
float BC_IPot::get_percentage()
{
- return ((float)value - minvalue) / (maxvalue - minvalue);
+ float range = maxvalue - minvalue;
+ return range > 0 ? ((float)value - minvalue) / range : minvalue;
}
int BC_IPot::percentage_to_value(float percentage)
}
int BC_IPot::percentage_to_value(float percentage)
@@
-635,7
+635,8
@@
const char* BC_QPot::get_caption()
float BC_QPot::get_percentage()
{
float BC_QPot::get_percentage()
{
- return ((float)value - minvalue) / (maxvalue - minvalue);
+ float range = maxvalue - minvalue;
+ return range > 0 ? ((float)value - minvalue) / range : 0;
}
int BC_QPot::percentage_to_value(float percentage)
}
int BC_QPot::percentage_to_value(float percentage)
@@
-711,7
+712,8
@@
const char* BC_PercentagePot::get_caption()
float BC_PercentagePot::get_percentage()
{
float BC_PercentagePot::get_percentage()
{
- return (value - minvalue) / (maxvalue - minvalue);
+ float range = maxvalue - minvalue;
+ return range > 0 ? (value - minvalue) / range : minvalue;
}
int BC_PercentagePot::percentage_to_value(float percentage)
}
int BC_PercentagePot::percentage_to_value(float percentage)