X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcpot.C;h=60807911b501ed6e628f6d3bb8a2046e40db43a6;hb=HEAD;hp=d9cb1594db9559cc9d49800630945d7ca7d6d123;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/bcpot.C b/cinelerra-5.1/guicast/bcpot.C index d9cb1594..60807911 100644 --- 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 "colors.h" +#include "bccolors.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(); - tooltip_done = 1; } return 1; } @@ -291,7 +290,6 @@ int BC_Pot::cursor_enter_event() { if(top_level->event_win == win && enabled) { - tooltip_done = 0; 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() { - return (value - minvalue) / (maxvalue - minvalue); + float range = maxvalue - minvalue; + return range > 0 ? (value - minvalue) / range : minvalue; } int BC_FPot::percentage_to_value(float percentage) @@ -551,7 +550,8 @@ const char* BC_IPot::get_caption() 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) @@ -635,7 +635,8 @@ const char* BC_QPot::get_caption() 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) @@ -711,7 +712,8 @@ const char* BC_PercentagePot::get_caption() 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)