fixing diagonal regions bug in periodic gesture detector