Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Leader and RichText block improvements
- Loading branch information
1 parent
7f07195
commit 6c69988
Showing
45 changed files
with
1,910 additions
and
683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ DrawLeaderLine::DrawLeaderLine(void) | |
ADD_PROPERTY_TYPE(StartSymbol, (-1), group, App::Prop_None, "Symbol (arrowhead) for start of line"); | ||
ADD_PROPERTY_TYPE(EndSymbol, (-1), group, App::Prop_None, "Symbol (arrowhead) for end of line"); | ||
ADD_PROPERTY_TYPE(Scalable ,(false),group,App::Prop_None,"Scale line with LeaderParent"); | ||
ADD_PROPERTY_TYPE(AutoHorizontal ,(getDefAuto()),group,App::Prop_None,"Forces last line segment horizontal"); | ||
|
||
//hide the DrawView properties that don't apply to Leader | ||
ScaleType.setStatus(App::Property::ReadOnly,true); | ||
|
@@ -76,11 +77,9 @@ DrawLeaderLine::~DrawLeaderLine() | |
|
||
void DrawLeaderLine::onChanged(const App::Property* prop) | ||
{ | ||
if (!isRestoring()) { | ||
//nothing in particular | ||
} | ||
// if (!isRestoring()) { | ||
// } | ||
DrawView::onChanged(prop); | ||
|
||
} | ||
|
||
short DrawLeaderLine::mustExecute() const | ||
|
@@ -113,6 +112,15 @@ App::DocumentObjectExecReturn *DrawLeaderLine::execute(void) | |
return DrawView::execute(); | ||
} | ||
|
||
//this doesn't really work because LeaderParent is not available? | ||
void DrawLeaderLine::onDocumentRestored(void) | ||
{ | ||
// Base::Console().Message("DLL::onDocumentRestored()\n"); | ||
requestPaint(); | ||
DrawView::onDocumentRestored(); | ||
} | ||
|
||
|
||
DrawView* DrawLeaderLine::getBaseView(void) const | ||
{ | ||
DrawView* result = nullptr; | ||
|
@@ -168,6 +176,33 @@ Base::Vector3d DrawLeaderLine::getAttachPoint(void) | |
return result; | ||
} | ||
|
||
void DrawLeaderLine::adjustLastSegment(void) | ||
{ | ||
// Base::Console().Message("DLL::adjustLastSegment()\n"); | ||
bool adjust = AutoHorizontal.getValue(); | ||
std::vector<Base::Vector3d> wp = WayPoints.getValues(); | ||
if (adjust) { | ||
if (wp.size() > 1) { | ||
int iLast = wp.size() - 1; | ||
int iPen = wp.size() - 2; | ||
Base::Vector3d last = wp.at(iLast); | ||
Base::Vector3d penUlt = wp.at(iPen); | ||
last.y = penUlt.y; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
WandererFan
Author
Contributor
|
||
wp.at(iLast) = last; | ||
} | ||
} | ||
WayPoints.setValues(wp); | ||
} | ||
|
||
bool DrawLeaderLine::getDefAuto(void) const | ||
{ | ||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")-> | ||
GetGroup("Preferences")->GetGroup("Mod/TechDraw/LeaderLines"); | ||
bool result = hGrp->GetBool("AutoHorizontal",true); | ||
return result; | ||
} | ||
|
||
|
||
PyObject *DrawLeaderLine::getPyObject(void) | ||
{ | ||
if (PythonObject.is(Py::_None())) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
src/Mod/TechDraw/App/DrawTextLeaderPy.xml → src/Mod/TechDraw/App/DrawRichAnnoPy.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Trying to determine if this line is why I see https://forum.freecadweb.org/viewtopic.php?f=3&t=73207&p=638814#p638814. I realise it's been a few years, but @WandererFan do you remember why this Y manipulation is made?