+ fixes #0001656: Vertical/horizontal distance constraint confuses for a line or two points
This commit is contained in:
parent
fba0ef0671
commit
ff09f0524d
|
@ -116,9 +116,10 @@ void EditDatumDialog::exec(bool atCursor)
|
|||
|
||||
//ui_ins_datum.lineEdit->setParamGrpPath("User parameter:History/Sketcher/SetDatum");
|
||||
|
||||
// e.g. an angle or a distance X or Y applied on a line or two vertexes
|
||||
if (Constr->Type == Sketcher::Angle ||
|
||||
((Constr->Type == Sketcher::DistanceX || Constr->Type == Sketcher::DistanceY) &&
|
||||
Constr->FirstPos == Sketcher::none || Constr->Second != Sketcher::Constraint::GeoUndef))
|
||||
(Constr->FirstPos == Sketcher::none || Constr->Second != Sketcher::Constraint::GeoUndef)))
|
||||
// hide negative sign
|
||||
init_val.setValue(std::abs(datum));
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <cmath>
|
||||
# include <QRegExp>
|
||||
# include <QString>
|
||||
#endif
|
||||
|
@ -437,7 +438,7 @@ void TaskSketcherConstrains::slotConstraintsChanged(void)
|
|||
case Sketcher::DistanceX:
|
||||
if (Filter<3 || !(*it)->Name.empty()) {
|
||||
ConstraintItem* item = new ConstraintItem(hdist,name,i-1,(*it)->Type);
|
||||
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity((*it)->Value,Base::Unit::Length).getUserString());
|
||||
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(std::abs((*it)->Value),Base::Unit::Length).getUserString());
|
||||
item->setData(Qt::UserRole, name);
|
||||
ui->listWidgetConstraints->addItem(item);
|
||||
}
|
||||
|
@ -445,7 +446,7 @@ void TaskSketcherConstrains::slotConstraintsChanged(void)
|
|||
case Sketcher::DistanceY:
|
||||
if (Filter<3 || !(*it)->Name.empty()) {
|
||||
ConstraintItem* item = new ConstraintItem(vdist,name,i-1,(*it)->Type);
|
||||
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity((*it)->Value,Base::Unit::Length).getUserString());
|
||||
name = QString::fromLatin1("%1 (%2)").arg(name).arg(Base::Quantity(std::abs((*it)->Value),Base::Unit::Length).getUserString());
|
||||
item->setData(Qt::UserRole, name);
|
||||
ui->listWidgetConstraints->addItem(item);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user