Updated  invert calculation to mach Flash Player functionality