Merge "Reset FontMetrics at each new measurement in BoringLayout" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
dcb2574ae1
@@ -300,6 +300,8 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
|
|||||||
Metrics fm = metrics;
|
Metrics fm = metrics;
|
||||||
if (fm == null) {
|
if (fm == null) {
|
||||||
fm = new Metrics();
|
fm = new Metrics();
|
||||||
|
} else {
|
||||||
|
fm.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
TextLine line = TextLine.obtain();
|
TextLine line = TextLine.obtain();
|
||||||
@@ -414,8 +416,6 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
|
|||||||
mEllipsizedCount = end - start;
|
mEllipsizedCount = end - start;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final char FIRST_RIGHT_TO_LEFT = '\u0590';
|
|
||||||
|
|
||||||
private String mDirect;
|
private String mDirect;
|
||||||
private Paint mPaint;
|
private Paint mPaint;
|
||||||
|
|
||||||
@@ -430,5 +430,14 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
|
|||||||
@Override public String toString() {
|
@Override public String toString() {
|
||||||
return super.toString() + " width=" + width;
|
return super.toString() + " width=" + width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reset() {
|
||||||
|
top = 0;
|
||||||
|
bottom = 0;
|
||||||
|
ascent = 0;
|
||||||
|
descent = 0;
|
||||||
|
width = 0;
|
||||||
|
leading = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user