Skip to content

Commit

Permalink
[bugfix] Corrected behavior on doubleplot-mode where the scale of the…
Browse files Browse the repository at this point in the history
… second plot scale was clipped to the first plot scale.
  • Loading branch information
lkz0ne committed Apr 25, 2022
1 parent f4e6a79 commit ee3c1fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OLED_SSD1306_Chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ bool OLED_SSD1306_Chart::updateChart(double firstValue, double secondValue)
secondValue = _y_max_values[1];
auto semiHeight = _chart_height / 2;
double y = (firstValue - _y_min_values[0]) * (-semiHeight) / (_y_max_values[0] - _y_min_values[0]) + _y_lower_left_coordinate;
double secondY = (secondValue - _y_min_values[1]) * (-semiHeight) / (_y_max_values[0] - _y_min_values[0]) + _y_lower_left_coordinate - semiHeight;
double secondY = (secondValue - _y_min_values[1]) * (-semiHeight) / (_y_max_values[1] - _y_min_values[1]) + _y_lower_left_coordinate - semiHeight;

_drawLine(_previous_x_coordinate[0] + _x_drawing_offset, _previous_y_coordinate[0], _actual_x_coordinate + _x_drawing_offset, y, WHITE, _lines_thickness[0]);
_drawLine(_previous_x_coordinate[1] + _x_drawing_offset, _previous_y_coordinate[1], _actual_x_coordinate + _x_drawing_offset, secondY, WHITE, _lines_thickness[1]);
Expand All @@ -279,4 +279,4 @@ bool OLED_SSD1306_Chart::updateChart(double firstValue, double secondValue)
display();
return true;
}
}
}

0 comments on commit ee3c1fe

Please sign in to comment.