Bug report #5025

issue in snapping of point

Added by Leyan Ouyang about 12 years ago. Updated about 10 years ago.

Assignee:Jürgen Fischer
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:14801


If I want to use snapping on a segment and move a point using node tool, the point will not snap to the line, but go a certain distance away. If I follow the line while continuously holding the mouse button, the point will follow and remain at the same distance.

This problem apparently appeared with the 6b07241f2447030bd5c9be374975d585ce0c15b2 to solve #5024.

fix_node_tool.patch Magnifier (10.4 KB) Leyan Ouyang, 2012-02-19 11:53 AM


#1 Updated by Leyan Ouyang about 12 years ago

I had a look at the code. It seems to be due to the use of the function closestVertex of on the geometry of the feature. As this geometry is not updated as soon as a vertex is modified, the old position is used and it creates issues in the calculation of the movement to apply.

Is there a reason not to use the coordinates of the snapped vertex snapResult.snappedVertex ? I tried and during my limited testing itworked perfectly.

I join a patch correcting this bug by using the snapped vertex information, as well as improving a few other things. My understanding of the code is still quite shallow and I am not very proficient with git and patching, please comment if there is any problem with the patch.

#2 Updated by Marco Hugentobler about 12 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Assignee set to Jürgen Fischer

#3 Updated by Paolo Cavallini over 11 years ago

  • Target version set to Version 2.0.0

#4 Updated by Jürgen Fischer over 10 years ago

  • Category set to Digitising

#5 Updated by Leyan Ouyang about 10 years ago

  • Status changed from Open to Closed

The problem went away, this bug can be closed.

Also available in: Atom PDF