Fix weird nullpointer #1404
This commit is contained in:
parent
19265217bd
commit
2dc7207f13
2 changed files with 2 additions and 1 deletions
|
@ -202,6 +202,7 @@ public class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider>
|
|||
* @return
|
||||
*/
|
||||
protected float getDistance(float x1, float y1, float x2, float y2) {
|
||||
//return Math.abs(x1 - x2);
|
||||
return (float) Math.hypot(x1 - x2, y1 - y2);
|
||||
}
|
||||
|
||||
|
|
|
@ -590,7 +590,7 @@ public class PieChartRenderer extends DataRenderer {
|
|||
*/
|
||||
protected void drawHole(Canvas c) {
|
||||
|
||||
if (mChart.isDrawHoleEnabled()) {
|
||||
if (mChart.isDrawHoleEnabled() && mBitmapCanvas != null) {
|
||||
|
||||
float radius = mChart.getRadius();
|
||||
float holeRadius = radius * (mChart.getHoleRadius() / 100);
|
||||
|
|
Loading…
Add table
Reference in a new issue