There is working code for this in one of the Pd forks. I've thought about porting it over. It works pretty well for placement but drawing the actual grid is problematic due to the number of lines and some overlapping.
On Feb 17, 2018, at 7:22 PM, pd-list-request@lists.iem.at wrote:
Date: Sat, 17 Feb 2018 17:25:51 +0100 From: Roman Haefeli <reduzent@gmail.com mailto:reduzent@gmail.com> To: pd-list@lists.iem.at mailto:pd-list@lists.iem.at Subject: [PD] snap to grid feature when editing Message-ID: <1518884751.2184.13.camel@gmail.com mailto:1518884751.2184.13.camel@gmail.com> Content-Type: text/plain; charset="utf-8"
Hey all
I just realized that I almost always hold the shift key down when moving objects around with arrow keys in order to emulate a 10-px grid. Considering my editing style, a snap-to-grid feature would make my patching life a lot easier. It would help me align objects vertically with the mouse whereas now I often rather drag over the object in order to align it with keys, because doing it with the mouse on a 1-px-grid is too finicky (for me at least).
Before I submit a feature request, I'd like to get a feeling if such a feature only suits my style or if it would be for the benefit of all.
Roman