Fix weird nullpointer #1404

This commit is contained in:
Philipp Jahoda 2016-06-19 21:19:08 +02:00
parent 19265217bd
commit 2dc7207f13
2 changed files with 2 additions and 1 deletions

View file

@ -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);
}

View file

@ -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);