47 lines
1.4 KiB
Java
47 lines
1.4 KiB
Java
|
package o;
|
||
|
|
||
|
import android.graphics.Paint;
|
||
|
import android.text.style.ReplacementSpan;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public abstract class ZBp extends ReplacementSpan {
|
||
|
private final C2650aic d;
|
||
|
private final Paint.FontMetricsInt b = new Paint.FontMetricsInt();
|
||
|
private short a = -1;
|
||
|
private short c = -1;
|
||
|
private float e = 1.0f;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public ZBp(C2650aic c2650aic) {
|
||
|
if (c2650aic != null) {
|
||
|
this.d = c2650aic;
|
||
|
return;
|
||
|
}
|
||
|
throw new NullPointerException("metadata cannot be null");
|
||
|
}
|
||
|
|
||
|
@Override // android.text.style.ReplacementSpan
|
||
|
public int getSize(Paint paint, CharSequence charSequence, int i, int i2, Paint.FontMetricsInt fontMetricsInt) {
|
||
|
paint.getFontMetricsInt(this.b);
|
||
|
this.e = Math.abs(this.b.descent - this.b.ascent) / this.d.a().b();
|
||
|
this.c = (short) (this.d.a().b() * this.e);
|
||
|
this.a = (short) (this.d.a().i() * this.e);
|
||
|
if (fontMetricsInt != null) {
|
||
|
fontMetricsInt.ascent = this.b.ascent;
|
||
|
fontMetricsInt.descent = this.b.descent;
|
||
|
fontMetricsInt.top = this.b.top;
|
||
|
fontMetricsInt.bottom = this.b.bottom;
|
||
|
}
|
||
|
return this.a;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final int c() {
|
||
|
return this.a;
|
||
|
}
|
||
|
|
||
|
public final C2650aic b() {
|
||
|
return this.d;
|
||
|
}
|
||
|
}
|