Allow selection of polygons through the segment that closes the path too

This commit is contained in:
Fabio D'Urso 2013-07-01 22:19:28 +02:00
parent 3c65f81fb9
commit 5888f65a2e

View file

@ -1560,7 +1560,12 @@ AnnotationPrivate* LineAnnotationPrivate::getNewAnnotationPrivate()
double LineAnnotationPrivate::distanceSqr( double x, double y, double xScale, double yScale )
{
return strokeDistance( ::distanceSqr( x, y, xScale, yScale, m_transformedLinePoints ),
QLinkedList<NormalizedPoint> transformedLinePoints = m_transformedLinePoints;
if ( m_lineClosed ) // Close the path
transformedLinePoints.append( transformedLinePoints.first() );
return strokeDistance( ::distanceSqr( x, y, xScale, yScale, transformedLinePoints ),
m_style.width() * xScale / ( m_page->m_width * 2 ) );
}