We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 1a61885 commit 110c8a0Copy full SHA for 110c8a0
src/quickgui/qgsquickmapsettings.cpp
@@ -118,7 +118,10 @@ QPointF QgsQuickMapSettings::coordinateToScreen( const QgsPoint &point ) const
118
119
QgsPoint QgsQuickMapSettings::screenToCoordinate( const QPointF &point ) const
120
{
121
- const QgsPointXY pp = mMapSettings.mapToPixel().toMapCoordinates( point.toPoint() );
+ // use floating point precision with mapToCoordinatesF
122
+ // this is to avoid rounding errors with an odd screen width or height
123
+ // and the point being set to the exact center of it
124
+ const QgsPointXY pp = mMapSettings.mapToPixel().toMapCoordinatesF( point.x(), point.y() );
125
return QgsPoint( pp );
126
}
127
0 commit comments