Skip to content

Commit ff0b8c3

Browse files
committed
Make these a little clearer
1 parent 0b43eea commit ff0b8c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MPChartLib/src/com/github/mikephil/charting/charts/BarLineChartBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ public int getLowestVisibleXIndex() {
13451345
mViewPortHandler.contentLeft(), mViewPortHandler.contentBottom()
13461346
};
13471347
getTransformer(AxisDependency.LEFT).pixelsToValue(pts);
1348-
return (pts[0] <= 0) ? 0 : (int) (pts[0] + 1.0f);
1348+
return (pts[0] <= 0) ? 0 : (int)Math.ceil(pts[0]);
13491349
}
13501350

13511351
/**
@@ -1360,7 +1360,7 @@ public int getHighestVisibleXIndex() {
13601360
mViewPortHandler.contentRight(), mViewPortHandler.contentBottom()
13611361
};
13621362
getTransformer(AxisDependency.LEFT).pixelsToValue(pts);
1363-
return (pts[0] >= mData.getXValCount()) ? mData.getXValCount() - 1 : (int) pts[0];
1363+
return Math.min(mData.getXValCount() - 1, (int)Math.floor(pts[0]));
13641364
}
13651365

13661366
/**

0 commit comments

Comments
 (0)