mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-16 04:31:04 +00:00
Fixes for temp display and start defines for engine load
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user