Bug report #5025
issue in snapping of point
|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.
#1 Updated by Leyan Ouyang over 8 years ago
- File fix_node_tool.patch added
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.