When in 2D mode, you can click on the magnet in the upper left corner to enable/disable snapping. If you click on the dots for the menu, there are several options. One reason why snapping often times works unexpected is, because it's not configured properly. In the menu, click on configure snap. There you can configure the pixel sizes for snapping.