Skip to content

Commit

Permalink
Merge pull request #544 from danielgindi/viewport-bugs
Browse files Browse the repository at this point in the history
Viewport bugfixes in LineChart
  • Loading branch information
PhilJay committed Apr 12, 2015
2 parents 847e6c3 + 791a487 commit 65c6189
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ protected void drawCubic(Canvas c, LineDataSet dataSet, List<Entry> entries) {
prevDx = (next.getXIndex() - cur.getXIndex()) * intensity;
prevDy = (next.getVal() - cur.getVal()) * intensity;

cur = entries.get(1);
next = entries.get((entries.size() > 2) ? 2 : 1);
cur = entries.get(minx + 1);
next = entries.get(minx + (size - minx > 2 ? 2 : 1));
curDx = (next.getXIndex() - prev.getXIndex()) * intensity;
curDy = (next.getVal() - prev.getVal()) * intensity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ public boolean isInBoundsLeft(float x) {
}

public boolean isInBoundsRight(float x) {
x = (float)((int)(x * 100.f)) / 100.f;
return mContentRect.right >= x ? true : false;
}

Expand All @@ -387,6 +388,7 @@ public boolean isInBoundsTop(float y) {
}

public boolean isInBoundsBottom(float y) {
y = (float)((int)(y * 100.f)) / 100.f;
return mContentRect.bottom >= y ? true : false;
}

Expand Down

0 comments on commit 65c6189

Please sign in to comment.