Skip to content
Snippets Groups Projects
Commit 93b77e14 authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Re #12808. Check for empty polygon before processing.

parent 628f6d0c
No related branches found
No related tags found
No related merge requests found
......@@ -558,6 +558,10 @@ void Shape2DFree::refit()
void Shape2DFree::resetBoundingRect()
{
m_boundingRect = getPolygonBoundingRect();
// Clear the outline path.
m_outline = QPainterPath();
if (m_polygon.isEmpty()) return;
// If the polygon has apparent holes/discontinuities
// it will have extra pairs of edges which we don't want
// to draw.
......@@ -588,8 +592,7 @@ void Shape2DFree::resetBoundingRect()
breaks.push_back(n);
}
qSort(breaks);
// Clear the outline path.
m_outline = QPainterPath();
m_outline.moveTo(m_polygon[0]);
int j1 = 0;
// Add contiguous portions of the polygon to the outline
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment