Set offsetX only if it is undefined