Skip to content
Permalink
Browse files

No need to crash when a user wants a highlight

Fix #17413
  • Loading branch information
m-kuhn committed Nov 7, 2017
1 parent ccd142f commit dc7ec1e1ca927a9b45466df85e14fb4083f7b80e
Showing with 1 addition and 1 deletion.
  1. +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 );
}

0 comments on commit dc7ec1e

Please sign in to comment.
You can’t perform that action at this time.