export function rpxToPx(unirpx: number): number {
    let gd = getApp<any>().globalData
    if (gd && gd.device && gd.device.windowWidth) {
        return (unirpx * gd.device.windowWidth) / 750;
    } else {
        return (unirpx * uni.getWindowInfo().windowWidth) / 750;
    }
    return unirpx;
}

export function pxToRpx(px: number): number {
    let gd = getApp<any>().globalData
    if (gd && gd.device && gd.device.windowWidth) {
        return (750 * px) / gd.device.windowWidth;
    } else {
        return (750 * px) / uni.getWindowInfo().windowWidth;
    }
    return px;
}

export const isDevTool =
    getApp<any>().globalData.device &&
    getApp<any>().globalData.device.platform === "devtools";
