if ( e->type() == QEvent::MouseButtonRelease && ( e->button() & sketchButton() ) )
{
- myResult = closed? Accept : Reject;
+ myResult = (closed && (points->count() > 2)) ? Accept : Reject;
QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
e->globalPos(), e->button(),
e->buttons(), e->modifiers() ) );
case Polygon:
{
QPolygon* aPolygon = (QPolygon*)mypSketcher->data();
- if( aPolygon )
+ if( aPolygon && (aPolygon->size() > 2))
{
int size = aPolygon->size();
TColgp_Array1OfPnt2d anArray(1, size);