Added snap-to-grid functionality to all diagrams