Skip to content

Commit

Permalink
Merge pull request #11 from lkz0ne/fix-doubleplot-issue-in-scale
Browse files Browse the repository at this point in the history
[bugfix] Corrected behavior on doubleplot-mode where the scale of the…
  • Loading branch information
elC0mpa authored Apr 25, 2022
2 parents f4e6a79 + ee3c1fe commit 0559080
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 0559080

Please sign in to comment.