Skip to content

Commit

Permalink
Fix for ticket #478/479. Changed number of decimals in writing world …
Browse files Browse the repository at this point in the history
…file and points-file

git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6367 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Jan 1, 2007
1 parent 280587d commit 7747d2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgeorefdatapoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ QgsGeorefDataPoint::QgsGeorefDataPoint(QgsMapCanvas* mapCanvas, int id,

void QgsGeorefDataPoint::drawShape(QPainter & p)
{
QString msg = QString("X %1\nY %2").arg(int(mMapCoords.x())).arg(int(mMapCoords.y()));
QString msg = QString("X %1\nY %2").arg(QString::number(mMapCoords.x(),'f')).arg(QString::number(mMapCoords.y(),'f'));
QPoint pnt = toCanvasCoords(mPixelCoords);
int x = pnt.x(), y = pnt.y();
QFont font;
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/georeferencer/qgspointdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ bool QgsPointDialog::generateWorldFile()
<<0<<endl
<<0<<endl
<<-pixelSize<<endl
<<(origin.x() - xOffset * pixelSize)<<endl
<<(origin.y() + yOffset * pixelSize)<<endl;
<<QString::number(origin.x() - xOffset * pixelSize, 'f')<<endl
<<QString::number(origin.y() + yOffset * pixelSize, 'f')<<endl;
// write the data points in case we need them later
QFile pointFile(mLayer->source() + ".points");
if (pointFile.open(QIODevice::WriteOnly))
Expand All @@ -386,7 +386,8 @@ bool QgsPointDialog::generateWorldFile()
for (unsigned int i = 0; i < mapCoords.size(); ++i)
{
points<<(QString("%1\t%2\t%3\t%4").
arg(mapCoords[i].x()).arg(mapCoords[i].y()).
arg(QString::number(mapCoords[i].x(), 'f')).
arg(QString::number(mapCoords[i].y(), 'f')).
arg(pixelCoords[i].x()).arg(pixelCoords[i].y()))<<endl;
}
}
Expand Down

0 comments on commit 7747d2e

Please sign in to comment.