#include "bcpot.h"
#include "bcresources.h"
-#include "colors.h"
+#include "bccolors.h"
#include "keys.h"
#include "units.h"
#include "vframe.h"
}
else
show_tooltip();
- tooltip_done = 1;
}
return 1;
}
{
if(top_level->event_win == win && enabled)
{
- tooltip_done = 0;
if(!top_level->button_down && status == POT_UP)
{
status = POT_HIGH;
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)
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)
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)
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)