Skip to content

Commit

Permalink
apply suggstions
Browse files Browse the repository at this point in the history
  • Loading branch information
roya0045 authored and nyalldawson committed Feb 9, 2021
1 parent 97b0cb8 commit ae32b3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/app/georeferencer/qgsgcpcanvasitem.cpp
Expand Up @@ -168,14 +168,8 @@ void QgsGCPCanvasItem::updatePosition()
if ( mDataPoint->canvasCoords().isEmpty() )
{
QgsCoordinateReferenceSystem mapCrs = mMapCanvas->mapSettings().destinationCrs();
QgsPointXY mapCoords;
if ( mapCrs.toWkt() == mDataPoint->crs().toWkt() )
mapCoords = mDataPoint->mapCoords();
else
{
QgsCoordinateTransform transf( mDataPoint->crs(), mapCrs, QgsProject::instance() );
mapCoords = transf.transform( mDataPoint->mapCoords() );
}
QgsCoordinateTransform transf( mDataPoint->crs(), mapCrs, QgsProject::instance() );
QgsPointXY mapCoords = transf.transform( mDataPoint->mapCoords() );
mDataPoint->setCanvasCoords( mapCoords );
}
setPos( toCanvasCoordinates( mDataPoint->canvasCoords() ) );
Expand Down
2 changes: 1 addition & 1 deletion src/app/georeferencer/qgsgeorefmainwindow.cpp
Expand Up @@ -542,7 +542,7 @@ void QgsGeoreferencerMainWindow::addPoint( const QgsPointXY &pixelCoords, const
{
QgsGeorefDataPoint *pnt = new QgsGeorefDataPoint( mCanvas, QgisApp::instance()->mapCanvas(), pixelCoords, mapCoords, crs, enable );
mPoints.append( pnt );
if ( !mLastGCPProjection.isValid() || mLastGCPProjection.toWkt() != crs.toWkt() )
if ( !mLastGCPProjection.isValid() || mLastGCPProjection != crs )
mLastGCPProjection = QgsCoordinateReferenceSystem( crs );
mGCPsDirty = true;
if ( finalize )
Expand Down

0 comments on commit ae32b3d

Please sign in to comment.