[L2Ork-dev] snap-to-grid

Jonathan Wilkes jon.w.wilkes at gmail.com
Tue Oct 20 12:31:22 EDT 2020


2nd question:

Suppose the mouse pointer and the top-left corner of the object underneath
it are both 2/3 of the way to the post office from their shared home.

1. Does the object wait until the mouse pointer has safely arrived at the
post office to "snap" itself to the post office?

Or

2. Does the object "snap" immediately to the post office at the first step
the mouse pointer takes toward the post office?

If it's #1, then the selection will wait at an unsnapped position until the
mouse arrives at a grid line/point. So the first step of an un-aligned
object will have a UX like "gravity"-- i.e., you are coaxing the selection
to its initial snap position. Also, the mouse may temporarily drag outside
the bounds of the object beneath it before the object snaps to its new
location.

If it's #2, then the selection will immediately align itself to the grid
constraints. This will provide consistency-- as any mouse motion will
guarantee grid alignment-- but have a jagged feel on the first mouse motion
of the un-aligned object. Edge case-- if the mouse is near the top-left
corner of an unaligned object, then the object's initial grid snap will
mean that the mouse will be outside the object's bounds for the rest of the
time it's dragging.

Since people generally drag more than one or two pixels with a mouse, I'm
leaning toward #1.

I want to pick a pattern before I implement it. The backend selection
motion deals with deltas instead of coords, and that makes this a bit more
of a pain than it should be.

-Jonathan

On Thu, Oct 15, 2020 at 12:48 AM Albert Graef <aggraef at gmail.com> wrote:

> Right. So I'd imagine that the object being dragged would snap to the
> grid, and the other selected objects would move along with it, keeping
> their relative positions.
>
> On Thu, Oct 15, 2020 at 4:59 AM Jonathan Wilkes <jon.w.wilkes at gmail.com>
> wrote:
>
>> Thanks for the report, Mario. That simplifies things quite a bit.
>>
>> -Jonathan
>>
>> On Wed, Oct 14, 2020 at 9:29 PM Mario Sottile - Marionetas Mey <
>> mariomey at gmail.com> wrote:
>>
>>> I think what I would like the feature to be... I tried with Inkscape and
>>> it works in the same way: arrow keys doesn't make objects snap to grid.
>>> Only mouse does. Arrow keys would be used for precise position.
>>>
>>> Shift-Arrow-Keys would not snap to grid. Again, they are for move
>>> objects faster and then, without Shift, precise position.
>>>
>>> Mario Sottile - Director
>>> (011) 15.6283.1576
>>> www.mariomey.com.ar
>>> info at mariomey.com.ar
>>> On 14/10/20 21:48, Jonathan Wilkes wrote:
>>>
>>> Hi all,
>>>
>>> Since we've got a grid in editmode now, I figured it's a good time to
>>> take the plunge and implement "snap-to-grid."
>>>
>>> I have an understanding of the basic use case. Here's an edge case:
>>>
>>> 1. Start with a spaghetti of objects positioned at arbitrary
>>> positions. Some may be aligned with the grid, some may not.
>>>
>>> 2. Select all.
>>>
>>> 3. Press `<rightArrow>
>>>
>>> According to existing GUI drawing programs that have a snap-to-grid
>>> feature, what happens in this case?
>>>
>>> Same question for `<shift-rightArrow>`.
>>>
>>> -Jonathan
>>> _______________________________________________
>>> L2Ork-dev mailing listL2Ork-dev at disis.music.vt.eduhttps://disis.music.vt.edu/listinfo/l2ork-dev
>>>
>>> _______________________________________________
>>> L2Ork-dev mailing list
>>> L2Ork-dev at disis.music.vt.edu
>>> https://disis.music.vt.edu/listinfo/l2ork-dev
>>
>> _______________________________________________
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://disis.music.vt.edu/pipermail/l2ork-dev/attachments/20201020/c31dc5e1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: firma.png
Type: image/png
Size: 4902 bytes
Desc: not available
URL: <http://disis.music.vt.edu/pipermail/l2ork-dev/attachments/20201020/c31dc5e1/attachment.png>


More information about the L2Ork-dev mailing list