Skip to content

Commit

Permalink
Fixing capture points
Browse files Browse the repository at this point in the history
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 23386bd
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 23386bd

Please sign in to comment.