Awesome!
It indeed already works (I now found the switch "snap guides while dragging") !  I'll tweak it a bit more, as it is not doing what I want it to do now :) and then add indicators for the other snaps aswell. Cool!
 
Johan
 


From: inkscape-devel-bounces@lists.sourceforge.net [mailto:inkscape-devel-bounces@lists.sourceforge.net] On Behalf Of Diederik van Lierop
Sent: maandag 3 maart 2008 18:35
To: Engelen, J.B.C. (Johan)
Cc: inkscape-devel@lists.sourceforge.net
Subject: Re: [Inkscape-devel] NEW: temporary on-canvas indicators

J.B.C.Engelen@...1578... wrote:
Although it seems the snappers return the necessary displacement, and not the point to which they snapped.

No, the snap manager returns an absolute position, for sure! There are some pieces of code that could easily lead to confusion on this matter, e.g. in the node tool.

 I propose to make the snappers return something like a SnapInfo struct:

struct SnapInfo {
	bool snapped;  //did we snap?
	Geom::Point snaplocation; // to which point did we snap
	SnapType type;  // some info about the sort of snap (tangential, node-on-node, whatever, this is future work of course)
	...
} 
  

The first two parameters are already being returned in current SVN. Currently we return a "SnappedPoint", as outlined in snapped-point.h

I do have a bugreport though: guides don't snap! the guideSnap function never gets past the check if it should snap at all, so it always returns Inkscape::SnappedPoint(p, NR_HUGE, 0, false). Can you look into this Diederik? Once guide snapping works, you'll see the snapindicator on-canvas :)
  
Is this the same as the issue below (which I discussed with Bulia on february 7th)? I'm thinking of making the whole guide-line snap again, as it used to do in the earliest implementations...

Copied from a previous mail to this list:

Diederik van Lierop wrote:
bulia byak wrote:
On Jan 13, 2008 3:39 PM, Diederik van Lierop <mail@...1689...> wrote:
  
This has been explained by Max and Gez, so I guess that has been cleared
up. BTW, what has changed recently is that only the part of the guide
near the cursor now snaps, not the full length of the guide.
    

Well, I just tried, and for me guideline does not snap to a rect,
after i ticked "snap guides while dragging" and both snap to paths and
snap to nodes. And dragging it with mouse over the rect. What am I
doing wrong?
  

It works for me. Are you moving the mouse pointer itself very close to the node you want to snap to? Because only a small part of the guide will snap, i.e. only that part of the guide that is within snap range from the pointer. BTW, although I've coded this myself, I'm not sure if I like this behaviour. It does give more control however, and an RFE was filed for this.