From 4006c6ee97bde0f184d8d67a73fce308bb413f85 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Wed, 6 Dec 2017 17:03:32 +0100 Subject: [PATCH] Sketcher: Fixes no horizontal/vertical on edge if previous horizontal/vert aligment on vertex ============================================================================================= fixes #3257 --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index d05e457413..323ee07404 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1158,12 +1158,12 @@ void CmdSketcherConstrainHorizontal::activated(int iMsg) // check if the edge has already a Horizontal or Vertical constraint for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); it != vals.end(); ++it) { - if ((*it)->Type == Sketcher::Horizontal && (*it)->First == GeoId){ + if ((*it)->Type == Sketcher::Horizontal && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none){ QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), QObject::tr("The selected edge has already a horizontal constraint!")); return; } - if ((*it)->Type == Sketcher::Vertical && (*it)->First == GeoId) { + if ((*it)->Type == Sketcher::Vertical && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), QObject::tr("The selected edge has already a vertical constraint!")); return; @@ -1388,12 +1388,12 @@ void CmdSketcherConstrainVertical::activated(int iMsg) // check if the edge has already a Horizontal or Vertical constraint for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); it != vals.end(); ++it) { - if ((*it)->Type == Sketcher::Vertical && (*it)->First == GeoId){ + if ((*it)->Type == Sketcher::Vertical && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none){ QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), QObject::tr("The selected edge has already a vertical constraint!")); return; } - if ((*it)->Type == Sketcher::Horizontal && (*it)->First == GeoId) { + if ((*it)->Type == Sketcher::Horizontal && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), QObject::tr("The selected edge has already a horizontral constraint!")); return;