mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-21 06:43:13 -08:00
Merge pull request #724 from justcallmekoko/develop
Channel analyzer graph scaling is more fluid
This commit is contained in:
@@ -2734,10 +2734,13 @@ void MenuFunctions::setGraphScale(float scale) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float MenuFunctions::calculateGraphScale(int16_t value) {
|
float MenuFunctions::calculateGraphScale(int16_t value) {
|
||||||
if (value < GRAPH_VERT_LIM) {
|
if ((value * this->_graph_scale < GRAPH_VERT_LIM) && (value * this->_graph_scale > GRAPH_VERT_LIM * 0.75)) {
|
||||||
return 1.0; // No scaling needed if the value is within the limit
|
return this->_graph_scale; // No scaling needed if the value is within the limit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value < GRAPH_VERT_LIM)
|
||||||
|
return 1.0;
|
||||||
|
|
||||||
// Calculate the multiplier proportionally
|
// Calculate the multiplier proportionally
|
||||||
return (0.75 * GRAPH_VERT_LIM) / value;
|
return (0.75 * GRAPH_VERT_LIM) / value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user