[L2Ork-dev] canvas snap-to-grid

Jonathan Wilkes jon.w.wilkes at gmail.com
Thu Oct 29 23:19:04 EDT 2020


On Thu, Oct 29, 2020 at 10:47 PM Albert Graef <aggraef at gmail.com> wrote:
>
> On Thu, Oct 29, 2020 at 10:30 PM Jonathan Wilkes <jon.w.wilkes at gmail.com> wrote:
>>
>> Canvas snap-to-grid feature is now available for review:
>>
>> https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/597
>
>
> Thanks a bunch, I've really been waiting for this! :)
>
> I already merged this into my testing branch and had a quick look, works fine for me so far.
>
> I noticed one cosmetic issue, though. I'd suggest changing the translations for prefs.gui.grid.show_grid and prefs.gui.grid.show_grid_tt. This option is still displayed as "grid background in edit mode" right now, but has actually become a "snap to grid" option.
>
> My suggested translations can be found at https://bitbucket.org/agraef/purr-data/commits/7aca2748. (@Joseph, can you please check my French? Thanks.)
>
> I already have these in my testing branch, so I can add this to your MR if you want. Just let me know.

Sure, that sound great.

>
> If anyone else wants to give it a go, try purr-data_2.15.2+git4745+7aca2748 which is currently building in the OBS preview channel at https://build.opensuse.org/package/show/home:aggraef:purr-data-git/purr-data.
>
>> Albert-- can you take a look at my math in canvas_snap_to_grid?
>
>
> Looks good to me!
>
>> I notice that once you start moving the selection, it kind of "snaps
>> backwards" to the "floor" gridline. Is there an easy way to fix it so
>> it always snaps to the closest gridline for the general case (e.g., in
>> the assignment to dx/dy below the snap_got_anchor conditional)?
>
>
> I haven't thought about this in any depth, but have you tried rounding just xnew-xwas to the nearest grid point and finally adding snap_dx, likewise for y? That said, for me it already works well enough as it is. :)

I haven't, out of fear and history of getting caught in a vicious
cycle of guessing-and-checking. :)

If you don't notice any problem with the snapping at the default cell
size, I'd say it's probably fine.

-Jonathan

>
> Albert
>
>>
>> -Jonathan
>> _______________________________________________
>> L2Ork-dev mailing list
>> L2Ork-dev at disis.music.vt.edu
>> https://disis.music.vt.edu/listinfo/l2ork-dev
>
>
>
> --
> Dr. Albert Gr"af
> Computer Music Research Group, JGU Mainz, Germany
> Email: aggraef at gmail.com, web: https://agraef.github.io/
> _______________________________________________
> L2Ork-dev mailing list
> L2Ork-dev at disis.music.vt.edu
> https://disis.music.vt.edu/listinfo/l2ork-dev


More information about the L2Ork-dev mailing list