package o; import android.graphics.Canvas; import android.graphics.DashPathEffect; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Typeface; import java.util.ArrayList; import java.util.List; import o.UFB; /* loaded from: classes.dex */ public final class pHy extends JGO { private Paint a; private Paint.FontMetrics b; private List c; public Paint d; private UFB e; private Path i; public pHy(DRH drh, UFB ufb) { super(drh); this.c = new ArrayList(16); this.b = new Paint.FontMetrics(); this.i = new Path(); this.e = ufb; Paint paint = new Paint(1); this.d = paint; paint.setTextSize(AbstractC0810PWv.d(9.0f)); this.d.setTextAlign(Paint.Align.LEFT); Paint paint2 = new Paint(1); this.a = paint2; paint2.setStyle(Paint.Style.FILL); } private void GI_(Canvas canvas, float f, float f2, EHj eHj, UFB ufb) { float f3; float f4; DashPathEffect dashPathEffect; if (eHj.c == 1122868 || eHj.c == 1122867 || eHj.c == 0) { return; } int save = canvas.save(); UFB.HBt hBt = eHj.a; if (hBt == UFB.HBt.DEFAULT) { hBt = ufb.u; } this.a.setColor(eHj.c); if (!Float.isNaN(eHj.e)) { f3 = eHj.e; } else { f3 = ufb.f; } float d = AbstractC0810PWv.d(f3); float f5 = d / 2.0f; int i = AnonymousClass2.d[hBt.ordinal()]; if (i == 3 || i == 4) { this.a.setStyle(Paint.Style.FILL); canvas.drawCircle(f + f5, f2, f5, this.a); } else if (i == 5) { this.a.setStyle(Paint.Style.FILL); canvas.drawRect(f, f2 - f5, f + d, f2 + f5, this.a); } else if (i == 6) { if (!Float.isNaN(eHj.b)) { f4 = eHj.b; } else { f4 = ufb.j; } float d2 = AbstractC0810PWv.d(f4); if (eHj.d != null) { dashPathEffect = eHj.d; } else { dashPathEffect = ufb.g; } this.a.setStyle(Paint.Style.STROKE); this.a.setStrokeWidth(d2); this.a.setPathEffect(dashPathEffect); this.i.reset(); this.i.moveTo(f, f2); this.i.lineTo(f + d, f2); canvas.drawPath(this.i, this.a); } canvas.restoreToCount(save); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.pHy$2, reason: invalid class name */ /* loaded from: classes.dex */ public static /* synthetic */ class AnonymousClass2 { static final int[] a; static final int[] b; static final int[] c; static final int[] d; static { int[] iArr = new int[UFB.HBt.values().length]; d = iArr; try { iArr[UFB.HBt.NONE.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { d[UFB.HBt.EMPTY.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { d[UFB.HBt.DEFAULT.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { d[UFB.HBt.CIRCLE.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { d[UFB.HBt.SQUARE.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { d[UFB.HBt.LINE.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } int[] iArr2 = new int[UFB.IeS.values().length]; c = iArr2; try { iArr2[UFB.IeS.HORIZONTAL.ordinal()] = 1; } catch (NoSuchFieldError unused7) { } try { c[UFB.IeS.VERTICAL.ordinal()] = 2; } catch (NoSuchFieldError unused8) { } int[] iArr3 = new int[UFB.LWm.values().length]; b = iArr3; try { iArr3[UFB.LWm.TOP.ordinal()] = 1; } catch (NoSuchFieldError unused9) { } try { b[UFB.LWm.BOTTOM.ordinal()] = 2; } catch (NoSuchFieldError unused10) { } try { b[UFB.LWm.CENTER.ordinal()] = 3; } catch (NoSuchFieldError unused11) { } int[] iArr4 = new int[UFB.Sts.values().length]; a = iArr4; try { iArr4[UFB.Sts.LEFT.ordinal()] = 1; } catch (NoSuchFieldError unused12) { } try { a[UFB.Sts.RIGHT.ordinal()] = 2; } catch (NoSuchFieldError unused13) { } try { a[UFB.Sts.CENTER.ordinal()] = 3; } catch (NoSuchFieldError unused14) { } } } /* JADX WARN: Type inference failed for: r4v1, types: [o.wQe] */ /* JADX WARN: Type inference failed for: r8v3, types: [o.wQe] */ public final void a(JfG jfG) { boolean z = this.e.f8385o; this.c.clear(); for (int i = 0; i < jfG.e(); i++) { ?? c = jfG.c(i); List b = c.b(); int r = c.r(); if (c instanceof InterfaceC8953daa) { InterfaceC8953daa interfaceC8953daa = (InterfaceC8953daa) c; if (interfaceC8953daa.z()) { String[] u = interfaceC8953daa.u(); for (int i2 = 0; i2 < b.size() && i2 < interfaceC8953daa.v(); i2++) { this.c.add(new EHj(u[i2 % u.length], c.c(), c.i(), c.a(), c.Gz_(), b.get(i2).intValue())); } if (interfaceC8953daa.h() != null) { this.c.add(new EHj(c.h(), UFB.HBt.NONE, Float.NaN, Float.NaN, null, 1122867)); } } } if (c instanceof InterfaceC1234Ypa) { InterfaceC1234Ypa interfaceC1234Ypa = (InterfaceC1234Ypa) c; for (int i3 = 0; i3 < b.size() && i3 < r; i3++) { this.c.add(new EHj(interfaceC1234Ypa.d(i3).b, c.c(), c.i(), c.a(), c.Gz_(), b.get(i3).intValue())); } if (interfaceC1234Ypa.h() != null) { this.c.add(new EHj(c.h(), UFB.HBt.NONE, Float.NaN, Float.NaN, null, 1122867)); } } else { if (c instanceof WXF) { WXF wxf = (WXF) c; if (wxf.u() != 1122867) { int u2 = wxf.u(); int v = wxf.v(); this.c.add(new EHj(null, c.c(), c.i(), c.a(), c.Gz_(), u2)); this.c.add(new EHj(c.h(), c.c(), c.i(), c.a(), c.Gz_(), v)); } } int i4 = 0; while (i4 < b.size() && i4 < r) { this.c.add(new EHj((i4 >= b.size() + (-1) || i4 >= r + (-1)) ? jfG.c(i).h() : null, c.c(), c.i(), c.a(), c.Gz_(), b.get(i4).intValue())); i4++; } } } EHj[] eHjArr = this.e.i; UFB ufb = this.e; List list = this.c; ufb.h = (EHj[]) list.toArray(new EHj[list.size()]); Typeface typeface = this.e.v; this.d.setTextSize(this.e.b()); this.d.setColor(this.e.r); this.e.Gu_(this.d, this.k); } public final void GJ_(Canvas canvas) { float f; float f2; float f3; float f4; float f5; float f6; List list; float f7; List list2; Canvas canvas2; int i; float f8; float f9; float f10; float f11; float f12; float f13; float f14; float f15; float f16; UFB.RVV rvv; EHj eHj; float f17; float f18; float f19; float width; double d; if (this.e.q) { Typeface typeface = this.e.v; this.d.setTextSize(this.e.b()); this.d.setColor(this.e.r); float Hh_ = AbstractC0810PWv.Hh_(this.d, this.b); float Hj_ = AbstractC0810PWv.Hj_(this.d, this.b) + AbstractC0810PWv.d(this.e.C); float Hc_ = Hh_ - (AbstractC0810PWv.Hc_(this.d, "ABC") / 2.0f); EHj[] eHjArr = this.e.h; float d2 = AbstractC0810PWv.d(this.e.l); float d3 = AbstractC0810PWv.d(this.e.B); UFB.IeS ieS = this.e.s; UFB.Sts sts = this.e.m; UFB.LWm lWm = this.e.D; UFB.RVV rvv2 = this.e.d; float d4 = AbstractC0810PWv.d(this.e.f); float d5 = AbstractC0810PWv.d(this.e.y); float d6 = this.e.d(); float e = this.e.e(); int i2 = AnonymousClass2.a[sts.ordinal()]; float f20 = d5; float f21 = d3; if (i2 != 1) { if (i2 == 2) { f = Hh_; f2 = Hj_; if (ieS == UFB.IeS.VERTICAL) { f19 = this.k.e; } else { f19 = this.k.b.right; } f4 = f19 - e; if (rvv2 == UFB.RVV.LEFT_TO_RIGHT) { f4 -= this.e.p; } } else if (i2 != 3) { f = Hh_; f2 = Hj_; f3 = 0.0f; } else { if (ieS == UFB.IeS.VERTICAL) { width = this.k.e / 2.0f; } else { width = this.k.b.left + (this.k.b.width() / 2.0f); } f4 = width + (rvv2 == UFB.RVV.LEFT_TO_RIGHT ? e : -e); if (ieS == UFB.IeS.VERTICAL) { f2 = Hj_; double d7 = f4; if (rvv2 == UFB.RVV.LEFT_TO_RIGHT) { f = Hh_; d = ((-this.e.p) / 2.0d) + e; } else { f = Hh_; d = (this.e.p / 2.0d) - e; } f4 = (float) (d7 + d); } else { f = Hh_; f2 = Hj_; } } f3 = f4; } else { f = Hh_; f2 = Hj_; if (ieS != UFB.IeS.VERTICAL) { e += this.k.b.left; } if (rvv2 == UFB.RVV.RIGHT_TO_LEFT) { f4 = this.e.p + e; f3 = f4; } else { f3 = e; } } int i3 = AnonymousClass2.c[ieS.ordinal()]; if (i3 != 1) { if (i3 == 2) { int i4 = AnonymousClass2.b[lWm.ordinal()]; if (i4 == 1) { f14 = (sts == UFB.Sts.CENTER ? 0.0f : this.k.b.top) + d6; } else if (i4 == 2) { if (sts == UFB.Sts.CENTER) { f18 = this.k.a; } else { f18 = this.k.b.bottom; } f14 = f18 - (this.e.n + d6); } else { f14 = i4 != 3 ? 0.0f : ((this.k.a / 2.0f) - (this.e.n / 2.0f)) + this.e.d(); } float f22 = f14; float f23 = 0.0f; boolean z = false; int i5 = 0; while (i5 < eHjArr.length) { EHj eHj2 = eHjArr[i5]; boolean z2 = eHj2.a != UFB.HBt.NONE; float d8 = Float.isNaN(eHj2.e) ? d4 : AbstractC0810PWv.d(eHj2.e); if (z2) { f17 = rvv2 == UFB.RVV.LEFT_TO_RIGHT ? f3 + f23 : f3 - (d8 - f23); float f24 = f22 + Hc_; f16 = f20; f15 = Hc_; rvv = rvv2; GI_(canvas, f17, f24, eHj2, this.e); if (rvv == UFB.RVV.LEFT_TO_RIGHT) { f17 += d8; } eHj = eHj2; } else { f15 = Hc_; f16 = f20; rvv = rvv2; eHj = eHj2; f17 = f3; } if (eHj.h != null) { if (z2 && !z) { f17 += rvv == UFB.RVV.LEFT_TO_RIGHT ? d2 : -d2; } else if (z) { f17 = f3; } if (rvv == UFB.RVV.RIGHT_TO_LEFT) { f17 -= AbstractC0810PWv.He_(this.d, eHj.h); } float f25 = f17; if (!z) { canvas.drawText(eHj.h, f25, f22 + f, this.d); } else { f22 += f + f2; canvas.drawText(eHj.h, f25, f22 + f, this.d); } f22 += f + f2; f23 = 0.0f; } else { f23 += d8 + f16; z = true; } i5++; f20 = f16; rvv2 = rvv; Hc_ = f15; } return; } return; } float f26 = f20; List list3 = this.e.b; List list4 = this.e.e; List list5 = this.e.a; int i6 = AnonymousClass2.b[lWm.ordinal()]; if (i6 != 1) { if (i6 == 2) { d6 = (this.k.a - d6) - this.e.n; } else { d6 = i6 != 3 ? 0.0f : d6 + ((this.k.a - this.e.n) / 2.0f); } } int length = eHjArr.length; float f27 = f3; int i7 = 0; int i8 = 0; while (i7 < length) { float f28 = f26; EHj eHj3 = eHjArr[i7]; int i9 = length; boolean z3 = eHj3.a != UFB.HBt.NONE; float d9 = Float.isNaN(eHj3.e) ? d4 : AbstractC0810PWv.d(eHj3.e); if (i7 >= list5.size() || !list5.get(i7).booleanValue()) { f5 = f27; f6 = d6; } else { f6 = d6 + f + f2; f5 = f3; } if (f5 == f3 && sts == UFB.Sts.CENTER && i8 < list3.size()) { if (rvv2 == UFB.RVV.RIGHT_TO_LEFT) { f13 = list3.get(i8).c; } else { f13 = -list3.get(i8).c; } f5 += f13 / 2.0f; i8++; } int i10 = i8; boolean z4 = eHj3.h == null; if (z3) { if (rvv2 == UFB.RVV.RIGHT_TO_LEFT) { f5 -= d9; } float f29 = f5; f7 = f3; i = i7; list = list5; list2 = list3; canvas2 = canvas; GI_(canvas, f29, f6 + Hc_, eHj3, this.e); f5 = rvv2 == UFB.RVV.LEFT_TO_RIGHT ? f29 + d9 : f29; } else { list = list5; f7 = f3; list2 = list3; canvas2 = canvas; i = i7; } if (!z4) { if (z3) { f5 += rvv2 == UFB.RVV.RIGHT_TO_LEFT ? -d2 : d2; } if (rvv2 == UFB.RVV.RIGHT_TO_LEFT) { f5 -= list4.get(i).c; } canvas2.drawText(eHj3.h, f5, f6 + f, this.d); if (rvv2 == UFB.RVV.LEFT_TO_RIGHT) { f5 += list4.get(i).c; } if (rvv2 == UFB.RVV.RIGHT_TO_LEFT) { f8 = f21; f12 = -f8; } else { f8 = f21; f12 = f8; } f11 = f5 + f12; f9 = f28; } else { f8 = f21; if (rvv2 == UFB.RVV.RIGHT_TO_LEFT) { f9 = f28; f10 = -f9; } else { f9 = f28; f10 = f9; } f11 = f5 + f10; } f21 = f8; f26 = f9; i7 = i + 1; d6 = f6; i8 = i10; f3 = f7; list5 = list; list3 = list2; f27 = f11; length = i9; } } } }