Discussion:
[Inkscape-user] Snap to grid when pasting
Vincent Hennebert
2008-07-31 11:51:44 UTC
Permalink
Hi,

Apologies if the issue is already known, but I haven't found anything
by making a Google search.

When I recently switched to Inkscape 0.46, I discovered that objects
are no longer snapped to the grid when pasted from the clipboard. It
used to work before and I was finding that quite handy. In the "Snap"
tab of the Document Properties dialog box I ticked the "Enable
snapping" and "Nodes" options.

The release notes for 0.46 say that grids have undergone big changes.
Did that behaviour get lost during the refactoring? Is that a new
option that I missed?

Many thanks for this wonderful software,
Vincent
Diederik van Lierop
2008-07-31 15:49:41 UTC
Permalink
Post by Vincent Hennebert
When I recently switched to Inkscape 0.46, I discovered that objects
are no longer snapped to the grid when pasted from the clipboard. [...]
Did that behaviour get lost during the refactoring?
Yes, it did get lost. I removed it because it was no longer functioning
properly. I might just as well create something similar again, but I'm
not sure how it should work. Given an object with lots of nodes, which
node should snap to the grid? If all nodes were already aligned to the
grid when copying, then while pasting snapping any node to the grid will
do. But this will not be true in general and there will be nodes both
on- and off-grid. Besides, we can now have multiple grids
simultaneously, which one should we use?

If we know where the clipboard data was originally located (I don't know
if that information is stored), then we might paste at a multiple of the
grid pitch (strictly spoken: that is not snapping, but it will achieve
what you're looking for).

Comments anyone?

Diederik
bulia byak
2008-07-31 16:26:52 UTC
Permalink
On Thu, Jul 31, 2008 at 12:49 PM, Diederik van Lierop
Post by Diederik van Lierop
If we know where the clipboard data was originally located (I don't know
if that information is stored)
Of course it is stored - the objecty is copied with its own transform
and other attributes, and that determines its position. When we "paste
in place", we simply paste and nothing else; on regular paste, we
paste and then move the pasted stuff to the point under cursor. This
also answers your other question on snapping: paste should snap
exactly the same as if the original object, without any copy/paste,
was just dragged by mouse to the current location in Selector.
--
bulia byak
Inkscape. Draw Freely.
http://www.inkscape.org
Diederik van Lierop
2008-07-31 18:04:13 UTC
Permalink
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
bulia byak wrote:
<blockquote
cite="mid:***@mail.gmail.com"
type="cite"> <pre wrap="">On Thu, Jul 31, 2008 at 12:49 PM, Diederik van Lierop <a class="moz-txt-link-rfc2396E" href="mailto:***@diedenrezi.nl">&lt;***@diedenrezi.nl&gt;</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">If we know where the clipboard data was originally located (I don't know
if that information is stored)
</pre>
</blockquote>
<pre wrap=""><!---->
Of course it is stored - the objecty is copied with its own transform
and other attributes, and that determines its position. When we "paste
in place", we simply paste and nothing else; on regular paste, we
paste and then move the pasted stuff to the point under cursor. </pre>
</blockquote>
<br>
OK, thanks for the info.<br>
<br>
<blockquote
cite="mid:***@mail.gmail.com"
type="cite">
<pre wrap="">This also answers your other question on snapping: paste should snap
exactly the same as if the original object, without any copy/paste,
was just dragged by mouse to the current location in Selector.
</pre>
</blockquote>
When pasting, it used to snap only to grids and not to other objects or
to guides (as it would when dragging). So it's a little bit different. <br>
<br>
But if we only snap to grids, then it would make more sense to me if
we'd use a multiple of the grid-pitch, instead of really snapping to
the grid. When making technical drawings I always end up with some
object aligned at half the grid pitch. Usually I don't want to double
the grid density for that single object. When pasting a selection with
both aligned and unaligned objects, I'd like to keep the aligned
objects aligned and not snap that single unaligned object to the grid.
Besides, a rectangle might have all its corners aligned but it's center
can be in between grid lines, so when this snaps the corners will
become unaligned. <br>
<br>
So, what's against using the multiple of the grid pitch? It does have
some advantages IMHO.<br>
<br>
Diederik<br>
<br>
</body>
</html>
bulia byak
2008-07-31 19:40:32 UTC
Permalink
But if we only snap to grids, then it would make more sense to me if we'd
use a multiple of the grid-pitch, instead of really snapping to the grid.
You mean, move the paste objects by a multiple of the grid-pitch?
That would make sense I think - so it will not really snap, but just
keep it being snapped if it already was.
--
bulia byak
Inkscape. Draw Freely.
http://www.inkscape.org
Vincent Hennebert
2008-08-01 10:30:51 UTC
Permalink
Thanks for your quick answers :-)
Post by bulia byak
But if we only snap to grids, then it would make more sense to me if we'd
use a multiple of the grid-pitch, instead of really snapping to the grid.
You mean, move the paste objects by a multiple of the grid-pitch?
That would make sense I think - so it will not really snap, but just
keep it being snapped if it already was.
Pasting at a multiple of the grid-pitch looks like a reasonable solution
to me. Shall I open a bug report to keep track of the issue, or is it
unnecessary?

Thanks,
Vincent
Abrolag
2008-08-01 19:40:18 UTC
Permalink
On Fri, 01 Aug 2008 11:30:51 +0100
Post by Vincent Hennebert
Thanks for your quick answers :-)
Post by bulia byak
But if we only snap to grids, then it would make more sense to me if we'd
use a multiple of the grid-pitch, instead of really snapping to the grid.
You mean, move the paste objects by a multiple of the grid-pitch?
That would make sense I think - so it will not really snap, but just
keep it being snapped if it already was.
Pasting at a multiple of the grid-pitch looks like a reasonable solution
to me. Shall I open a bug report to keep track of the issue, or is it
unnecessary?
Thanks,
Vincent
I'd like to see this too.
--
Will J Godfrey
http://www.musically.me.uk
Diederik van Lierop
2008-08-02 07:00:18 UTC
Permalink
Post by Vincent Hennebert
Pasting at a multiple of the grid-pitch looks like a reasonable solution
to me. Shall I open a bug report to keep track of the issue, or is it
unnecessary?
You can if you want to keep track of it, but it's already on my TODO
list so it will be implemented sooner or later.
Diederik
Diederik van Lierop
2008-08-06 21:26:12 UTC
Permalink
Post by Vincent Hennebert
Pasting at a multiple of the grid-pitch looks like a reasonable solution
to me.
It's been re-invented and committed to SVN. Please be alert for any bugs
I might have introduced.

Regards,

Diederik

Diederik van Lierop
2008-08-02 07:08:36 UTC
Permalink
Given an object with lots of nodes, which node should snap to the grid?
The one which is the closest to the mouse pointer. At least this is
what I would expect. Or that this can be turned ON/OFF somewhere.
Because right now it is really hard to use snapping with the paths
that have many nodes close to each other.
True, and that's why this is also on my TODO list. But I don't think
this will be very useful specifically when pasting, or is it?

Diederik
Loading...