[TD] fix order of arrow heads

see https://forum.freecadweb.org/viewtopic.php?f=35&t=44334#p378675
This commit is contained in:
donovaly
2020-03-21 01:21:20 +01:00
committed by WandererFan
parent 30a0047cd4
commit 6fa80d8cbf
6 changed files with 20 additions and 18 deletions

View File

@@ -30,23 +30,23 @@
namespace TechDraw {
const int ArrowPropEnum::ArrowCount = 8;
const char* ArrowPropEnum::ArrowTypeEnums[]= { "None",
"Filled Arrow",
const char* ArrowPropEnum::ArrowTypeEnums[]= { "Filled Arrow",
"Open Arrow",
"Tick",
"Dot",
"Open Circle",
"Fork",
"Filled Triangle",
"None",
NULL};
const std::vector<std::string> ArrowPropEnum::ArrowTypeIcons = { ":icons/arrownone.svg",
":icons/arrowfilled.svg",
const std::vector<std::string> ArrowPropEnum::ArrowTypeIcons = { ":icons/arrowfilled.svg",
":icons/arrowopen.svg",
":icons/arrowtick.svg",
":icons/arrowdot.svg",
":icons/arrowopendot.svg",
":icons/arrowfork.svg",
":icons/arrowpyramid.svg"};
":icons/arrowpyramid.svg",
":icons/arrownone.svg"};
}

View File

@@ -47,7 +47,7 @@ using namespace TechDraw;
PROPERTY_SOURCE(TechDraw::DrawLeaderLine, TechDraw::DrawView)
//TODO: share this between DrawViewBalloon, DrawLeaderLine, QGIArrow, Prefs, etc
//const char* DrawLeaderLine::ArrowTypeEnums[]= { "NONE",
//const char* DrawLeaderLine::ArrowTypeEnums[]= {
// "FILLED_ARROW",
// "OPEN_ARROW",
// "TICK",
@@ -55,8 +55,9 @@ PROPERTY_SOURCE(TechDraw::DrawLeaderLine, TechDraw::DrawView)
// "OPEN_CIRCLE",
// "FORK",
// "FILLED_TRIANGLE",
// "NONE"
// NULL};
//const char* DrawLeaderLine::ArrowTypeEnums2[]= { "NONE",
//const char* DrawLeaderLine::ArrowTypeEnums2[]= {
// "FILLED_ARROW",
// "OPEN_ARROW",
// "TICK",
@@ -64,6 +65,7 @@ PROPERTY_SOURCE(TechDraw::DrawLeaderLine, TechDraw::DrawView)
// "OPEN_CIRCLE",
// "FORK",
// "FILLED_TRIANGLE",
// "NONE"
// NULL};
DrawLeaderLine::DrawLeaderLine(void)
@@ -80,11 +82,11 @@ DrawLeaderLine::DrawLeaderLine(void)
// ADD_PROPERTY(EndType,(prefEnd()));
StartSymbol.setEnums(ArrowPropEnum::ArrowTypeEnums);
ADD_PROPERTY(StartSymbol,(1l)); //filled arrow
ADD_PROPERTY(StartSymbol,(0l)); //filled arrow
// ADD_PROPERTY_TYPE(StartSymbol, (0), group, App::Prop_None, "Symbol (arrowhead) for start of line");
EndSymbol.setEnums(ArrowPropEnum::ArrowTypeEnums);
ADD_PROPERTY(EndSymbol,(0l)); //no symbol
ADD_PROPERTY(EndSymbol,(7l)); //no symbol
// ADD_PROPERTY_TYPE(EndSymbol, (0), group, App::Prop_None, "Symbol (arrowhead) for end of line");

View File

@@ -131,7 +131,7 @@ int DlgPrefsTechDraw3Imp::prefBalloonArrow(void) const
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Decorations");
int end = hGrp->GetInt("BalloonArrow", 1);
int end = hGrp->GetInt("BalloonArrow", 0);
return end;
}
@@ -140,7 +140,7 @@ int DlgPrefsTechDraw3Imp::prefArrowStyle(void) const
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Dimensions");
int style = hGrp->GetInt("ArrowStyle", 1);
int style = hGrp->GetInt("ArrowStyle", 0);
return style;
}

View File

@@ -313,7 +313,7 @@ int QGIArrow::getPrefArrowStyle()
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Dimensions");
int style = hGrp->GetInt("ArrowStyle", 1);
int style = hGrp->GetInt("ArrowStyle", 0);
return style;
}

View File

@@ -1198,11 +1198,11 @@ void QGIViewDimension::drawArrows(int count, const Base::Vector2d positions[], d
arrow->setSize(QGIArrow::getPrefArrowSize());
arrow->setFlipped(flipped);
if (QGIArrow::getPrefArrowStyle() != 0) { // if not "None"
arrow->draw();
arrow->show();
}
else
if (QGIArrow::getPrefArrowStyle() != 7) { // if not "None"
arrow->draw();
arrow->show();
}
else
arrow->hide();
}
}

View File

@@ -727,7 +727,7 @@ int TaskLeaderLine::getPrefArrowStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
int style = hGrp->GetInt("ArrowStyle", 1);
int style = hGrp->GetInt("ArrowStyle", 0);
return style;
}