aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Cohen Gindi <danielgindi@gmail.com>2020-01-23 15:45:57 +0200
committerDaniel Cohen Gindi <danielgindi@gmail.com>2020-01-23 15:45:57 +0200
commitf05337768d87bdd57eaed378fd2fe1a6346b0300 (patch)
tree23f137a38802e5f22fd66443ff39c211eb7e4609
parentf8d068d377db45d37675357fe19fcfb7113ef708 (diff)
downloadMPAndroidChart-f05337768d87bdd57eaed378fd2fe1a6346b0300.tar.gz
Finalized vertical line collision check
-rw-r--r--MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java
index 849bc4a7..a00860b5 100644
--- a/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java
+++ b/MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.java
@@ -379,8 +379,8 @@ public class LineChartRenderer extends LineRadarRenderer {
// make sure the lines don't do shitty things outside
// bounds
if (!mViewPortHandler.isInBoundsLeft(lastCoordinateX) ||
- !mViewPortHandler.isInBoundsTop(lastCoordinateY) ||
- !mViewPortHandler.isInBoundsBottom(firstCoordinateY))
+ !mViewPortHandler.isInBoundsTop(Math.max(firstCoordinateY, lastCoordinateY)) ||
+ !mViewPortHandler.isInBoundsBottom(Math.min(firstCoordinateY, lastCoordinateY)))
continue;
// get the color that is set for this line-segment