Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utils.FLOAT_EPSILON is a value slightly greater than one… #2467

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ protected void drawDataSet(Canvas c, IPieDataSet dataSet) {
int visibleAngleCount = 0;
for (int j = 0; j < entryCount; j++) {
// draw only if the value is greater than zero
if ((Math.abs(dataSet.getEntryForIndex(j).getY()) > Utils.FLOAT_EPSILON)) {
if ((Math.abs(dataSet.getEntryForIndex(j).getY()) > 0)) {
visibleAngleCount++;
}
}
Expand All @@ -247,7 +247,7 @@ protected void drawDataSet(Canvas c, IPieDataSet dataSet) {
Entry e = dataSet.getEntryForIndex(j);

// draw only if the value is greater than zero
if ((Math.abs(e.getY()) > Utils.FLOAT_EPSILON)) {
if ((Math.abs(e.getY()) > 0)) {

if (!mChart.needsHighlight(j)) {

Expand All @@ -269,7 +269,7 @@ protected void drawDataSet(Canvas c, IPieDataSet dataSet) {
float arcStartPointX = center.x + radius * (float) Math.cos(startAngleOuter * Utils.FDEG2RAD);
float arcStartPointY = center.y + radius * (float) Math.sin(startAngleOuter * Utils.FDEG2RAD);

if (sweepAngleOuter % 360f <= Utils.FLOAT_EPSILON) {
if (sweepAngleOuter % 360f == 0.f) {
// Android is doing "mod 360"
mPathBuffer.addCircle(center.x, center.y, radius, Path.Direction.CW);
} else {
Expand Down Expand Up @@ -772,7 +772,7 @@ public void drawHighlighted(Canvas c, Highlight[] indices) {
int visibleAngleCount = 0;
for (int j = 0; j < entryCount; j++) {
// draw only if the value is greater than zero
if ((Math.abs(set.getEntryForIndex(j).getY()) > Utils.FLOAT_EPSILON)) {
if ((Math.abs(set.getEntryForIndex(j).getY()) > 0)) {
visibleAngleCount++;
}
}
Expand Down