package i2;

import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import h2.C0619a;

/* JADX INFO: loaded from: classes.dex */
public final class p extends t {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final r f6634c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final float f6635d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final float f6636e;

    public p(r rVar, float f6, float f7) {
        this.f6634c = rVar;
        this.f6635d = f6;
        this.f6636e = f7;
    }

    @Override // i2.t
    public final void a(Matrix matrix, C0619a c0619a, int i, Canvas canvas) {
        r rVar = this.f6634c;
        float f6 = rVar.f6645c;
        float f7 = this.f6636e;
        float f8 = rVar.f6644b;
        float f9 = this.f6635d;
        RectF rectF = new RectF(0.0f, 0.0f, (float) Math.hypot(f6 - f7, f8 - f9), 0.0f);
        Matrix matrix2 = this.f6648a;
        matrix2.set(matrix);
        matrix2.preTranslate(f9, f7);
        matrix2.preRotate(b());
        c0619a.getClass();
        rectF.bottom += i;
        rectF.offset(0.0f, -i);
        int[] iArr = C0619a.i;
        iArr[0] = c0619a.f6526f;
        iArr[1] = c0619a.f6525e;
        iArr[2] = c0619a.f6524d;
        Paint paint = c0619a.f6523c;
        float f10 = rectF.left;
        paint.setShader(new LinearGradient(f10, rectF.top, f10, rectF.bottom, iArr, C0619a.f6518j, Shader.TileMode.CLAMP));
        canvas.save();
        canvas.concat(matrix2);
        canvas.drawRect(rectF, paint);
        canvas.restore();
    }

    public final float b() {
        r rVar = this.f6634c;
        return (float) Math.toDegrees(Math.atan((rVar.f6645c - this.f6636e) / (rVar.f6644b - this.f6635d)));
    }
}
