Fix for snap when window is slightly misaligned.