Performance improved

Finding offsetLeft, offsetRight, offsetWidth, offsetHeight takes more
time, so passing them as parameter and saving them as object has
increased performance from 320ms to 50ms.