mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-05 20:40:25 -08:00
Merge pull request #972 from justcallmekoko/develop
Final graph scale check before display
This commit is contained in:
@@ -4144,8 +4144,10 @@ void MenuFunctions::drawGraphSmall(uint8_t *values) {
|
||||
maxValue = values[targ_val];
|
||||
}
|
||||
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT / 2 + 1, bar_width, TFT_HEIGHT / 2 + 1, TFT_BLACK);
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT - (values[targ_val] * this->_graph_scale), bar_width, values[targ_val] * this->_graph_scale, TFT_CYAN);
|
||||
if (values[targ_val] * this->_graph_scale <= GRAPH_VERT_LIM) {
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT / 2 + 1, bar_width, TFT_HEIGHT / 2 + 1, TFT_BLACK);
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT - (values[targ_val] * this->_graph_scale), bar_width, values[targ_val] * this->_graph_scale, TFT_CYAN);
|
||||
}
|
||||
|
||||
display_obj.tft.drawLine(x_coord - 2, TFT_HEIGHT - GRAPH_VERT_LIM - (CHAR_WIDTH * 2), x_coord - 2, TFT_HEIGHT, TFT_WHITE);
|
||||
}
|
||||
@@ -4159,8 +4161,10 @@ void MenuFunctions::drawGraphSmall(uint8_t *values) {
|
||||
maxValue = values[targ_val];
|
||||
}
|
||||
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT / 2 + 1, bar_width, TFT_HEIGHT / 2 + 1, TFT_BLACK);
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT - (values[targ_val] * this->_graph_scale), bar_width, values[targ_val] * this->_graph_scale, TFT_CYAN);
|
||||
if (values[targ_val] * this->_graph_scale <= GRAPH_VERT_LIM) {
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT / 2 + 1, bar_width, TFT_HEIGHT / 2 + 1, TFT_BLACK);
|
||||
display_obj.tft.fillRect(x_coord, TFT_HEIGHT - (values[targ_val] * this->_graph_scale), bar_width, values[targ_val] * this->_graph_scale, TFT_CYAN);
|
||||
}
|
||||
|
||||
display_obj.tft.drawLine(x_coord - 2, TFT_HEIGHT - GRAPH_VERT_LIM - (CHAR_WIDTH * 2), x_coord - 2, TFT_HEIGHT, TFT_WHITE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user