Skip to content
Permalink
Browse files
Fixing capture points
git-svn-id: http://svn.osgeo.org/qgis/trunk@8009 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Jan 20, 2008
1 parent 4635c89 commit 23386bd0c1ff612ead11563c43f356172bd1d309
Showing with 17 additions and 15 deletions.
  1. +17 −15 src/app/qgsmaptooladdfeature.cpp
@@ -25,6 +25,7 @@
#include "qgsrubberband.h"
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgslogger.h"
#include <QMessageBox>

QgsMapToolAddFeature::QgsMapToolAddFeature(QgsMapCanvas* canvas, enum CaptureTool tool): QgsMapToolCapture(canvas, tool)
@@ -96,21 +97,22 @@ void QgsMapToolAddFeature::canvasReleaseEvent(QMouseEvent * e)
QList<QgsSnappingResult> snapResults;
QgsPoint savePoint; //point in layer coordinates

if(mSnapper.snapToBackgroundLayers(e->pos(), snapResults) != 0)
{
QgsPoint savePoint = snapPointFromResults(snapResults, e->pos());
try
{
savePoint = toLayerCoords(vlayer, idPoint);
}
catch(QgsCsException &cse)
{
UNUSED(cse);
QMessageBox::information(0, QObject::tr("Coordinate transform error"), \
QObject::tr("Cannot transform the point to the layers coordinate system"));
return;
}
}
if(mSnapper.snapToBackgroundLayers(e->pos(), snapResults) == 0)
{
idPoint = snapPointFromResults(snapResults, e->pos());
try
{
savePoint = toLayerCoords(vlayer, idPoint);
QgsDebugMsg("savePoint = " + savePoint.stringRep());
}
catch(QgsCsException &cse)
{
UNUSED(cse);
QMessageBox::information(0, QObject::tr("Coordinate transform error"), \
QObject::tr("Cannot transform the point to the layers coordinate system"));
return;
}
}

// emit signal - QgisApp can catch it and save point position to clipboard
// FIXME: is this still actual or something old that's not used anymore?

0 comments on commit 23386bd

Please sign in to comment.