Skip to content

Commit 4b3825c

Browse files
committed
Revert PhilJay#1684
1 parent 10676ea commit 4b3825c

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

MPChartLib/src/com/github/mikephil/charting/renderer/XAxisRenderer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import android.graphics.Paint.Align;
88
import android.graphics.Path;
99
import android.graphics.PointF;
10-
import android.util.Size;
1110

1211
import com.github.mikephil.charting.components.LimitLine;
1312
import com.github.mikephil.charting.components.XAxis;
@@ -189,7 +188,7 @@ protected void drawLabels(Canvas c, float pos, PointF anchor) {
189188

190189
protected void drawLabel(Canvas c, String label, int xIndex, float x, float y, PointF anchor, float angleDegrees) {
191190
String formattedLabel = mXAxis.getValueFormatter().getXValue(label, xIndex, mViewPortHandler);
192-
Utils.drawText(c, formattedLabel, x, y, mAxisLabelPaint, anchor, angleDegrees);
191+
Utils.drawXAxisValue(c, formattedLabel, x, y, mAxisLabelPaint, anchor, angleDegrees);
193192
}
194193

195194
@Override

MPChartLib/src/com/github/mikephil/charting/utils/Utils.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -532,22 +532,17 @@ public static float getNormalizedAngle(float angle) {
532532

533533
private static Rect mDrawTextRectBuffer = new Rect();
534534
private static Paint.FontMetrics mFontMetricsBuffer = new Paint.FontMetrics();
535-
private static float mLineHeight = 9999.0f;
536535

537-
public static void drawText(Canvas c, String text, float x, float y,
538-
Paint paint,
539-
PointF anchor, float angleDegrees) {
536+
public static void drawXAxisValue(Canvas c, String text, float x, float y,
537+
Paint paint,
538+
PointF anchor, float angleDegrees) {
540539

541540
float drawOffsetX = 0.f;
542541
float drawOffsetY = 0.f;
543542

544543
paint.getTextBounds(text, 0, text.length(), mDrawTextRectBuffer);
545544

546-
if(mDrawTextRectBuffer.height() < mLineHeight){
547-
mLineHeight = mDrawTextRectBuffer.height();
548-
}
549-
550-
final float lineHeight = mLineHeight;
545+
final float lineHeight = mDrawTextRectBuffer.height();
551546

552547
// Android sometimes has pre-padding
553548
drawOffsetX -= mDrawTextRectBuffer.left;

0 commit comments

Comments
 (0)