210 lines
6.2 KiB
Java
210 lines
6.2 KiB
Java
|
package o;
|
||
|
|
||
|
import android.graphics.Rect;
|
||
|
import android.view.MotionEvent;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
|
||
|
/* loaded from: classes3.dex */
|
||
|
public class tOX {
|
||
|
public int a;
|
||
|
public Rect b;
|
||
|
public final ZGg c;
|
||
|
public float d;
|
||
|
public int e;
|
||
|
public float g;
|
||
|
public int h;
|
||
|
public int j;
|
||
|
private int k;
|
||
|
private float l;
|
||
|
private int t;
|
||
|
public float f = -1.0f;
|
||
|
public EvK i = new EvK();
|
||
|
|
||
|
/* renamed from: o, reason: collision with root package name */
|
||
|
private final int f9278o = 2;
|
||
|
private final EvK[] n = new EvK[2];
|
||
|
private final EvK[] m = new EvK[2];
|
||
|
|
||
|
public tOX(ZGg zGg) {
|
||
|
this.c = zGg;
|
||
|
this.g = zGg.a;
|
||
|
this.l = zGg.c;
|
||
|
}
|
||
|
|
||
|
public void onEvent(MotionEvent motionEvent) {
|
||
|
EvK evK;
|
||
|
EvK evK2;
|
||
|
EvK evK3;
|
||
|
int actionIndex = motionEvent.getActionIndex();
|
||
|
if (actionIndex >= this.f9278o) {
|
||
|
return;
|
||
|
}
|
||
|
int actionMasked = motionEvent.getActionMasked();
|
||
|
if (actionMasked == 6 || actionMasked == 1) {
|
||
|
this.m[actionIndex] = null;
|
||
|
this.n[actionIndex] = null;
|
||
|
} else {
|
||
|
for (int i = 0; i < this.f9278o; i++) {
|
||
|
if (i < motionEvent.getPointerCount()) {
|
||
|
float x = motionEvent.getX(i);
|
||
|
float y = motionEvent.getY(i);
|
||
|
EvK[] evKArr = this.n;
|
||
|
if (evKArr[i] == null) {
|
||
|
evKArr[i] = new EvK(x, y);
|
||
|
this.m[i] = null;
|
||
|
} else {
|
||
|
EvK[] evKArr2 = this.m;
|
||
|
if (evKArr2[i] == null) {
|
||
|
evKArr2[i] = new EvK();
|
||
|
}
|
||
|
EvK evK4 = this.m[i];
|
||
|
EvK evK5 = this.n[i];
|
||
|
evK4.d = evK5.d;
|
||
|
evK4.c = evK5.c;
|
||
|
EvK evK6 = this.n[i];
|
||
|
evK6.d = x;
|
||
|
evK6.c = y;
|
||
|
}
|
||
|
} else {
|
||
|
this.m[i] = null;
|
||
|
this.n[i] = null;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (d() == 1) {
|
||
|
EvK evK7 = this.i;
|
||
|
EvK evK8 = this.n[0];
|
||
|
if (evK8 != null) {
|
||
|
EvK evK9 = this.m[0];
|
||
|
if (evK9 == null) {
|
||
|
evK9 = evK8;
|
||
|
}
|
||
|
evK3 = new EvK(evK8.d - evK9.d, evK8.c - evK9.c);
|
||
|
} else {
|
||
|
evK3 = new EvK();
|
||
|
}
|
||
|
evK7.d += evK3.d;
|
||
|
evK7.c += evK3.c;
|
||
|
}
|
||
|
if (d() == 2) {
|
||
|
EvK[] evKArr3 = this.n;
|
||
|
EvK evK10 = evKArr3[0];
|
||
|
EvK evK11 = evKArr3[1];
|
||
|
EvK evK12 = new EvK(evK11.d - evK10.d, evK11.c - evK10.c);
|
||
|
EvK[] evKArr4 = this.m;
|
||
|
EvK evK13 = evKArr4[0];
|
||
|
if (evK13 == null || (evK2 = evKArr4[1]) == null) {
|
||
|
EvK[] evKArr5 = this.n;
|
||
|
EvK evK14 = evKArr5[0];
|
||
|
EvK evK15 = evKArr5[1];
|
||
|
evK = new EvK(evK15.d - evK14.d, evK15.c - evK14.c);
|
||
|
} else {
|
||
|
evK = new EvK(evK2.d - evK13.d, evK2.c - evK13.c);
|
||
|
}
|
||
|
float f = evK12.d;
|
||
|
float f2 = evK12.c;
|
||
|
float sqrt = (float) Math.sqrt((f * f) + (f2 * f2));
|
||
|
float f3 = evK.d;
|
||
|
float f4 = evK.c;
|
||
|
float sqrt2 = (float) Math.sqrt((f3 * f3) + (f4 * f4));
|
||
|
float f5 = this.f;
|
||
|
if (sqrt2 != BitmapDescriptorFactory.HUE_RED) {
|
||
|
f5 *= sqrt / sqrt2;
|
||
|
}
|
||
|
float f6 = this.g;
|
||
|
if (f5 < f6) {
|
||
|
f5 = f6;
|
||
|
}
|
||
|
float f7 = this.l;
|
||
|
if (f5 > f7) {
|
||
|
f5 = f7;
|
||
|
}
|
||
|
this.f = f5;
|
||
|
e();
|
||
|
}
|
||
|
int actionMasked2 = motionEvent.getActionMasked();
|
||
|
if (actionMasked2 == 6 || actionMasked2 == 1) {
|
||
|
c();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private int d() {
|
||
|
int i = 0;
|
||
|
for (EvK evK : this.n) {
|
||
|
if (evK != null) {
|
||
|
i++;
|
||
|
}
|
||
|
}
|
||
|
return i;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:12:0x0038, code lost:
|
||
|
|
||
|
if (r1 > r4) goto L17;
|
||
|
*/
|
||
|
/* JADX WARN: Removed duplicated region for block: B:11:0x0033 */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
public final void c() {
|
||
|
/*
|
||
|
r6 = this;
|
||
|
android.graphics.Rect r0 = r6.b
|
||
|
if (r0 != 0) goto L5
|
||
|
return
|
||
|
L5:
|
||
|
o.EvK r0 = r6.i
|
||
|
float r0 = r0.c
|
||
|
android.graphics.Rect r1 = r6.b
|
||
|
int r1 = r1.bottom
|
||
|
float r2 = (float) r1
|
||
|
int r3 = r6.t
|
||
|
float r4 = r2 - r0
|
||
|
float r5 = (float) r3
|
||
|
int r4 = (r4 > r5 ? 1 : (r4 == r5 ? 0 : -1))
|
||
|
if (r4 < 0) goto L19
|
||
|
int r1 = r1 - r3
|
||
|
goto L20
|
||
|
L19:
|
||
|
float r2 = r0 - r2
|
||
|
int r2 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))
|
||
|
if (r2 < 0) goto L21
|
||
|
int r1 = r1 + r3
|
||
|
L20:
|
||
|
float r0 = (float) r1
|
||
|
L21:
|
||
|
o.EvK r1 = r6.i
|
||
|
float r1 = r1.d
|
||
|
android.graphics.Rect r2 = r6.b
|
||
|
int r2 = r2.right
|
||
|
int r3 = r6.k
|
||
|
int r4 = r2 - r3
|
||
|
float r5 = (float) r4
|
||
|
int r5 = (r1 > r5 ? 1 : (r1 == r5 ? 0 : -1))
|
||
|
if (r5 > 0) goto L33
|
||
|
goto L3a
|
||
|
L33:
|
||
|
int r4 = r2 + r3
|
||
|
float r2 = (float) r4
|
||
|
int r2 = (r1 > r2 ? 1 : (r1 == r2 ? 0 : -1))
|
||
|
if (r2 <= 0) goto L3b
|
||
|
L3a:
|
||
|
float r1 = (float) r4
|
||
|
L3b:
|
||
|
o.EvK r2 = r6.i
|
||
|
r2.d = r1
|
||
|
r2.c = r0
|
||
|
return
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: o.tOX.c():void");
|
||
|
}
|
||
|
|
||
|
public final void e() {
|
||
|
float f = this.e;
|
||
|
float f2 = this.f;
|
||
|
this.k = (((int) (f * f2)) - this.h) / 2;
|
||
|
this.t = (((int) (this.a * f2)) - this.j) / 2;
|
||
|
}
|
||
|
}
|