Fixes for temp display and start defines for engine load

This commit is contained in:
SemvdH
2025-05-04 22:08:24 +02:00
parent 48933e2bab
commit 34b287f871
4 changed files with 118 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
void bar_draw_horizontal(int start_x, int start_y, int width, int height, int value, int max_value, uint color, char fill_outline, UTFT *display)
{
display->setColor(color);
int bar_width = (int)((float)value / (float)max_value * width);
int bar_width = (int)(((float)value / (float)max_value) * (float)width);
if (fill_outline)
{
display->drawRect(start_x, start_y, start_x + width, start_y + height);
@@ -14,7 +14,7 @@ void bar_draw_horizontal(int start_x, int start_y, int width, int height, int va
void bar_draw_horizontal(int start_x, int start_y, int width, int height, int value, int max_value, byte r, byte g, byte b, char fill_outline, UTFT *display)
{
display->setColor(r,g,b);
int bar_width = (int)((float)value / (float)max_value * width);
int bar_width = (int)(((float)value / (float)max_value) * (float)width);
if (fill_outline)
{
display->drawRect(start_x, start_y, start_x + width, start_y + height);
@@ -25,7 +25,7 @@ void bar_draw_horizontal(int start_x, int start_y, int width, int height, int va
void bar_draw_vertical(int start_x, int start_y, int width, int height, int value, int max_value, uint color, char fill_outline, UTFT *display)
{
display->setColor(color);
int bar_height = (int)((float)value / (float)max_value * height);
int bar_height = (int)(((float)value / (float)max_value) * (float)height);
if (fill_outline)
{
display->drawRect(start_x, start_y, start_x + width, start_y + height);
@@ -36,7 +36,7 @@ void bar_draw_vertical(int start_x, int start_y, int width, int height, int valu
void bar_draw_vertical(int start_x, int start_y, int width, int height, int value, int max_value, byte r, byte g, byte b, char fill_outline, UTFT *display)
{
display->setColor(r,g,b);
int bar_height = (int)((float)value / (float)max_value * height);
int bar_height = (int)(((float)value / (float)max_value) * (float)height);
if (fill_outline)
{
display->drawRect(start_x, start_y, start_x + width, start_y + height);