diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index c3b4dc425..5f565ddeb 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -62,6 +62,7 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, con this, &DialogPointOfIntersection::PointNameChanged); line = new VisToolPointOfIntersection(data); + line->VisualMode(NULL_ID); } //--------------------------------------------------------------------------------------------------------------------- @@ -103,7 +104,8 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point for Y value (horizontal)"))) { number++; - line->VisualMode(id); + line->setPoint1Id(id); + line->RefreshGeometry(); } break; case 1: @@ -173,7 +175,6 @@ void DialogPointOfIntersection::ShowVisualization() { VMainGraphicsScene *scene = qApp->getCurrentScene(); connect(scene, &VMainGraphicsScene::NewFactor, line, &VisLine::SetFactor); - scene->addItem(line); line->RefreshGeometry(); } } diff --git a/src/app/visualization/vistoolpointofintersection.cpp b/src/app/visualization/vistoolpointofintersection.cpp index 85c84af8a..6427eb3f3 100644 --- a/src/app/visualization/vistoolpointofintersection.cpp +++ b/src/app/visualization/vistoolpointofintersection.cpp @@ -48,12 +48,18 @@ VisToolPointOfIntersection::~VisToolPointOfIntersection() //--------------------------------------------------------------------------------------------------------------------- void VisToolPointOfIntersection::RefreshGeometry() { - if (point1Id > NULL_ID) + QLineF axisL1; + if (point1Id <= NULL_ID) + { + axisL1 = Axis(Visualization::scenePos, 90); + DrawLine(this, axisL1, supportColor, Qt::DashLine); + } + else { const QSharedPointer first = Visualization::data->GeometricObject(point1Id); DrawPoint(axisP1, first->toQPointF(), supportColor); - QLineF axisL1 = Axis(first->toQPointF(), 90); + axisL1 = Axis(first->toQPointF(), 90); DrawLine(this, axisL1, supportColor, Qt::DashLine); QLineF axisL2;