From 22f52e41015348e516f06fe1bf841643f7da798d Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 21 Nov 2014 19:24:16 +0200 Subject: [PATCH] Curved path should have three or more points. --HG-- branch : develop --- src/app/dialogs/tools/dialogsplinepath.cpp | 7 +++++-- src/app/visualization/vistoolsplinepath.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index 7a05b4c45..a4ae01409 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -236,8 +236,11 @@ void DialogSplinePath::ShowDialog(bool click) { if (click == false) { - emit ToolTip(""); - DialogAccepted(); + if (path.CountPoint() >= 3) + { + emit ToolTip(""); + DialogAccepted(); + } } } diff --git a/src/app/visualization/vistoolsplinepath.cpp b/src/app/visualization/vistoolsplinepath.cpp index f6388d8b8..e5e12a212 100644 --- a/src/app/visualization/vistoolsplinepath.cpp +++ b/src/app/visualization/vistoolsplinepath.cpp @@ -82,7 +82,15 @@ void VisToolSplinePath::RefreshGeometry() DrawPath(this, path.GetPath(PathDirection::Show), mainColor, Qt::SolidLine, Qt::RoundCap); } - Visualization::toolTip = QString(tr("Curve path: Enter - finish creation")); + if (path.CountPoint() < 3) + { + Visualization::toolTip = QString(tr("Curve path: select three or more points")); + } + else + { + Visualization::toolTip = QString(tr("Curve path: select three or more points, " + "Enter - finish creation")); + } } }