matplotlib/matplotlib — pull request #726 by leejjoon (2012-02-28 06:35:46+00:00)
Title: improve snapping algorithm

I think the current snapping gives somewhat wrong result.

```c
*x = mpl_round(*x) + m_snap_value;
*y = mpl_round(*y) + m_snap_value;
```

For example, consider m_snap_value=0.5 and (x, y) = (0.45, 0.55). This is supposed to be snapped to (0.5, 0.5) but the above code gives (0.5, 1.5). And I think the right thing to do is subtract m_snap_value before rounding.

```c
*x = mpl_round(*x-m_snap_value) + m_snap_value;
*y = mpl_round(*y-m_snap_value) + m_snap_value;
```