Skip to content

Commit

Permalink
[TD]fix Leader end type selection
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Mar 23, 2020
1 parent 3e00de2 commit 779ebb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Mod/TechDraw/Gui/QGILeaderLine.cpp
Expand Up @@ -424,11 +424,11 @@ QPainterPath QGILeaderLine::makeLeaderPath(std::vector<QPointF> qPoints)
double endAdjLength(0.0);
if (qPoints.size() > 1) {
//make path adjustment to hide leaderline ends behind arrowheads
if (featLeader->StartSymbol.getValue() > ArrowType::NONE) {
if (featLeader->StartSymbol.getValue() != ArrowType::NONE) {
startAdjLength = QGIArrow::getOverlapAdjust(featLeader->StartSymbol.getValue(),
QGIArrow::getPrefArrowSize());
}
if (featLeader->EndSymbol.getValue() > ArrowType::NONE) {
if (featLeader->EndSymbol.getValue() != ArrowType::NONE) {
endAdjLength = QGIArrow::getOverlapAdjust(featLeader->EndSymbol.getValue(),
QGIArrow::getPrefArrowSize());
}
Expand Down Expand Up @@ -499,7 +499,7 @@ void QGILeaderLine::setArrows(std::vector<QPointF> pathPoints)

QPointF lastOffset = (pathPoints.back() - pathPoints.front());

if (featLeader->StartSymbol.getValue() > ArrowType::NONE) {
if (featLeader->StartSymbol.getValue() != ArrowType::NONE) {
m_arrow1->setStyle(featLeader->StartSymbol.getValue());
m_arrow1->setWidth(getLineWidth());
// TODO: variable size arrow heads
Expand All @@ -521,7 +521,7 @@ void QGILeaderLine::setArrows(std::vector<QPointF> pathPoints)
m_arrow1->hide();
}

if (featLeader->EndSymbol.getValue() > ArrowType::NONE) {
if (featLeader->EndSymbol.getValue() != ArrowType::NONE) {
m_arrow2->setStyle(featLeader->EndSymbol.getValue());
m_arrow2->setWidth(getLineWidth());
m_arrow2->setDirMode(true);
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/TechDraw/Gui/TaskLeaderLine.cpp
Expand Up @@ -46,6 +46,7 @@
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawLeaderLine.h>
#include <Mod/TechDraw/App/ArrowPropEnum.h>

#include <Mod/TechDraw/Gui/ui_TaskLeaderLine.h>

Expand Down Expand Up @@ -267,7 +268,7 @@ void TaskLeaderLine::setUiPrimary()
ui->cboxStartSym->setCurrentIndex(aStyle);

DrawGuiUtil::loadArrowBox(ui->cboxEndSym);
ui->cboxEndSym->setCurrentIndex(0);
ui->cboxEndSym->setCurrentIndex(TechDraw::ArrowType::NONE);

ui->dsbWeight->setUnit(Base::Unit::Length);
ui->dsbWeight->setMinimum(0);
Expand Down

0 comments on commit 779ebb7

Please sign in to comment.