Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
No need to crash when a user wants a highlight
- Loading branch information
Showing
with
1 addition
and
1 deletion.
-
+1
−1
src/gui/qgshighlight.cpp
|
@@ -242,7 +242,7 @@ void QgsHighlight::paintPolygon( QPainter *p, const QgsPolygonXY &polygon ) |
|
|
{ |
|
|
//adding point only if it is more than a pixel apart from the previous one |
|
|
const QPointF curVertex = toCanvasCoordinates( sourceVertex ) - pos(); |
|
|
if ( std::abs( ring.back().x() - curVertex.x() ) > 1 || std::abs( ring.back().y() - curVertex.y() ) > 1 ) |
|
|
if ( ring.isEmpty() || std::abs( ring.back().x() - curVertex.x() ) > 1 || std::abs( ring.back().y() - curVertex.y() ) > 1 ) |
|
|
{ |
|
|
ring.push_back( curVertex ); |
|
|
} |
|
|