fix snapToGrid bug, off by 1