Skip to content

Commit

Permalink
fix(ios): dont use bitmap canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Sep 22, 2020
1 parent b371f6a commit d279a97
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/charting/renderer/PieChartRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ export class PieChartRenderer extends DataRenderer {

public drawExtras(c: Canvas) {
this.drawHole(c);
c.drawBitmap(this.mDrawBitmap.get(), 0, 0, null);
if (this.mDrawBitmap.get()) {
c.drawBitmap(this.mDrawBitmap.get(), 0, 0, null);
}
this.drawCenterText(c);
}

Expand All @@ -592,7 +594,7 @@ export class PieChartRenderer extends DataRenderer {

if (ColorTemplate.getColorInstance(this.mHolePaint.getColor()).a > 0) {
// draw the hole-circle
this.mBitmapCanvas.drawCircle(center.x, center.y, holeRadius, this.mHolePaint);
c.drawCircle(center.x, center.y, holeRadius, this.mHolePaint);
}

// only draw the circle if it can be seen (not covered by the hole)
Expand All @@ -608,7 +610,7 @@ export class PieChartRenderer extends DataRenderer {
this.mHoleCirclePath.reset();
this.mHoleCirclePath.addCircle(center.x, center.y, secondHoleRadius, Direction.CW);
this.mHoleCirclePath.addCircle(center.x, center.y, holeRadius, Direction.CCW);
this.mBitmapCanvas.drawPath(this.mHoleCirclePath, this.mTransparentCirclePaint);
c.drawPath(this.mHoleCirclePath, this.mTransparentCirclePaint);

// reset alpha
this.mTransparentCirclePaint.setAlpha(alpha);
Expand Down

0 comments on commit d279a97

Please sign in to comment.