Skip to content

Commit

Permalink
[TD]Hatch - handle empty parameter - use default
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Mar 20, 2020
1 parent 509cbfa commit 4a0ab01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Mod/TechDraw/App/DrawHatch.cpp
Expand Up @@ -270,6 +270,9 @@ std::string DrawHatch::prefSvgHatch(void)
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/Patterns/";
std::string defaultFileName = defaultDir + "simple.svg";
std::string result = hGrp->GetASCII("FileHatch",defaultFileName.c_str());
if (result.empty()) {
result = defaultFileName;
}
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/Gui/QGIViewPart.cpp
Expand Up @@ -441,11 +441,11 @@ void QGIViewPart::draw() {

void QGIViewPart::drawViewPart()
{
// Base::Console().Message("QGIVP::DVP()\n");
auto viewPart( dynamic_cast<TechDraw::DrawViewPart *>(getViewObject()) );
if ( viewPart == nullptr ) {
return;
}
// Base::Console().Message("QGIVP::DVP() - %s / %s\n", viewPart->getNameInDocument(), viewPart->Label.getValue());
if (!viewPart->hasGeometry()) {
removePrimitives(); //clean the slate
removeDecorations();
Expand Down Expand Up @@ -508,7 +508,7 @@ void QGIViewPart::drawViewPart()
}
}
} else if (fHatch) {
if (!fHatch->HatchPattern.isEmpty()) {
if (!fHatch->SvgIncluded.isEmpty()) {
if (getExporting()) {
newFace->hideSvg(true);
newFace->isHatched(false);
Expand Down

0 comments on commit 4a0ab01

Please sign in to comment.