[TD]Hatch - handle empty parameter - use default

This commit is contained in:
wandererfan
2020-03-20 14:08:52 -04:00
committed by WandererFan
parent 509cbfa53c
commit 4a0ab015f6
2 changed files with 5 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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();
@@ -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);