package jxl.biff.drawing;

import common.Logger;
import jxl.biff.IntegerHelper;

/* JADX INFO: loaded from: classes.dex */
class ClientAnchor extends EscherAtom {
    static /* synthetic */ Class class$jxl$biff$drawing$ClientAnchor;
    private static final Logger logger;
    private byte[] data;
    private int properties;
    private double x1;
    private double x2;
    private double y1;
    private double y2;

    static {
        Class clsClass$ = class$jxl$biff$drawing$ClientAnchor;
        if (clsClass$ == null) {
            clsClass$ = class$("jxl.biff.drawing.ClientAnchor");
            class$jxl$biff$drawing$ClientAnchor = clsClass$;
        }
        logger = Logger.getLogger(clsClass$);
    }

    public ClientAnchor(EscherRecordData escherRecordData) {
        super(escherRecordData);
        byte[] bytes = getBytes();
        this.properties = IntegerHelper.getInt(bytes[0], bytes[1]);
        this.x1 = ((double) IntegerHelper.getInt(bytes[2], bytes[3])) + (((double) IntegerHelper.getInt(bytes[4], bytes[5])) / 1024.0d);
        this.y1 = ((double) IntegerHelper.getInt(bytes[6], bytes[7])) + (((double) IntegerHelper.getInt(bytes[8], bytes[9])) / 256.0d);
        this.x2 = ((double) IntegerHelper.getInt(bytes[10], bytes[11])) + (((double) IntegerHelper.getInt(bytes[12], bytes[13])) / 1024.0d);
        this.y2 = ((double) IntegerHelper.getInt(bytes[14], bytes[15])) + (((double) IntegerHelper.getInt(bytes[16], bytes[17])) / 256.0d);
    }

    static /* synthetic */ Class class$(String str) {
        try {
            return Class.forName(str);
        } catch (ClassNotFoundException e) {
            throw new NoClassDefFoundError(e.getMessage());
        }
    }

    @Override // jxl.biff.drawing.EscherAtom, jxl.biff.drawing.EscherRecord
    byte[] getData() {
        byte[] bArr = new byte[18];
        this.data = bArr;
        IntegerHelper.getTwoBytes(this.properties, bArr, 0);
        IntegerHelper.getTwoBytes((int) this.x1, this.data, 2);
        double d = this.x1;
        IntegerHelper.getTwoBytes((int) ((d - ((double) ((int) d))) * 1024.0d), this.data, 4);
        IntegerHelper.getTwoBytes((int) this.y1, this.data, 6);
        double d2 = this.y1;
        IntegerHelper.getTwoBytes((int) ((d2 - ((double) ((int) d2))) * 256.0d), this.data, 8);
        IntegerHelper.getTwoBytes((int) this.x2, this.data, 10);
        double d3 = this.x2;
        IntegerHelper.getTwoBytes((int) ((d3 - ((double) ((int) d3))) * 1024.0d), this.data, 12);
        IntegerHelper.getTwoBytes((int) this.y2, this.data, 14);
        double d4 = this.y2;
        IntegerHelper.getTwoBytes((int) ((d4 - ((double) ((int) d4))) * 256.0d), this.data, 16);
        return setHeaderData(this.data);
    }

    int getProperties() {
        return this.properties;
    }

    double getX1() {
        return this.x1;
    }

    double getX2() {
        return this.x2;
    }

    double getY1() {
        return this.y1;
    }

    double getY2() {
        return this.y2;
    }

    public ClientAnchor(double d, double d2, double d3, double d4, int i2) {
        super(EscherRecordType.CLIENT_ANCHOR);
        this.x1 = d;
        this.y1 = d2;
        this.x2 = d3;
        this.y2 = d4;
        this.properties = i2;
    }
}
