GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge · FlyingAndroid/MPAndroidChart@12d5b85

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • MPChartLib/src/main/java/com/github/mikephil/charting
    • listener
      • BarLineChartTouchListener.java
    • renderer
      • PieChartRenderer.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎MPChartLib/src/main/java/com/github/mikephil/charting/listener/BarLineChartTouchListener.java‎

Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/listener/BarLineChartTouchListener.java
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ public boolean onTouch(View v, MotionEvent event) {
149149
if (mChart.isPinchZoomEnabled()) {
150150
mTouchMode = PINCH_ZOOM;
151151
} else {
152-
if (mSavedXDist > mSavedYDist)
153-
mTouchMode = X_ZOOM;
154-
else
155-
mTouchMode = Y_ZOOM;
152+
if (mChart.isScaleXEnabled() != mChart.isScaleYEnabled()) {
153+
mTouchMode = mChart.isScaleXEnabled() ? X_ZOOM : Y_ZOOM;
154+
} else {
155+
mTouchMode = mSavedXDist > mSavedYDist ? X_ZOOM : Y_ZOOM;
156+
}
156157
}
157158
}
158159

Collapse file

‎MPChartLib/src/main/java/com/github/mikephil/charting/renderer/PieChartRenderer.java‎

Copy file name to clipboardExpand all lines: MPChartLib/src/main/java/com/github/mikephil/charting/renderer/PieChartRenderer.java
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ protected void drawDataSet(Canvas c, IPieDataSet dataSet) {
229229
int visibleAngleCount = 0;
230230
for (int j = 0; j < entryCount; j++) {
231231
// draw only if the value is greater than zero
232-
if ((Math.abs(dataSet.getEntryForIndex(j).getY()) > 0.000001)) {
232+
if ((Math.abs(dataSet.getEntryForIndex(j).getY()) > Utils.FLOAT_EPSILON)) {
233233
visibleAngleCount++;
234234
}
235235
}
@@ -244,7 +244,7 @@ protected void drawDataSet(Canvas c, IPieDataSet dataSet) {
244244
Entry e = dataSet.getEntryForIndex(j);
245245

246246
// draw only if the value is greater than zero
247-
if ((Math.abs(e.getY()) > 0.000001)) {
247+
if ((Math.abs(e.getY()) > Utils.FLOAT_EPSILON)) {
248248

249249
if (!mChart.needsHighlight(j)) {
250250

@@ -265,7 +265,7 @@ protected void drawDataSet(Canvas c, IPieDataSet dataSet) {
265265

266266
float arcStartPointX = 0.f, arcStartPointY = 0.f;
267267

268-
if (sweepAngleOuter % 360f < Utils.FLOAT_EPSILON) {
268+
if (sweepAngleOuter % 360f <= Utils.FLOAT_EPSILON) {
269269
// Android is doing "mod 360"
270270
mPathBuffer.addCircle(center.x, center.y, radius, Path.Direction.CW);
271271
} else {
@@ -771,7 +771,7 @@ public void drawHighlighted(Canvas c, Highlight[] indices) {
771771
int visibleAngleCount = 0;
772772
for (int j = 0; j < entryCount; j++) {
773773
// draw only if the value is greater than zero
774-
if ((Math.abs(set.getEntryForIndex(j).getY()) > 0.000001)) {
774+
if ((Math.abs(set.getEntryForIndex(j).getY()) > Utils.FLOAT_EPSILON)) {
775775
visibleAngleCount++;
776776
}
777777
}
@@ -958,7 +958,7 @@ protected void drawRoundedSlices(Canvas c) {
958958
Entry e = dataSet.getEntryForIndex(j);
959959

960960
// draw only if the value is greater than zero
961-
if ((Math.abs(e.getY()) > 0.000001)) {
961+
if ((Math.abs(e.getY()) > Utils.FLOAT_EPSILON)) {
962962

963963
float x = (float) ((r - circleRadius)
964964
* Math.cos(Math.toRadians((angle + sliceAngle)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.