From 30ff7fb6e4cc8a9b5e96f35959eaf668bc129b33 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Wed, 15 Jul 2020 19:07:59 -0400 Subject: [PATCH] [TD]multiple faces in GeomHatch --- src/Mod/TechDraw/Gui/QGIViewPart.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index 0be0303ecb..926bf4e7fb 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewPart.cpp @@ -482,8 +482,7 @@ void QGIViewPart::drawViewPart() if (fGeom) { const std::vector &sourceNames = fGeom->Source.getSubValues(); if (!sourceNames.empty()) { - int fdx = TechDraw::DrawUtil::getIndexFromName(sourceNames.at(0)); - std::vector lineSets = fGeom->getTrimmedLines(fdx); + std::vector lineSets = fGeom->getTrimmedLines(i); if (!lineSets.empty()) { newFace->clearLineSets(); for (auto& ls: lineSets) { @@ -1148,7 +1147,6 @@ TechDraw::DrawHatch* QGIViewPart::faceIsHatched(int i,std::vector &sourceNames = h->Source.getSubValues(); for (auto& s: sourceNames) { -// int fdx = TechDraw::DrawUtil::getIndexFromName(sourceNames.at(0)); //this sb a loop through all subs int fdx = TechDraw::DrawUtil::getIndexFromName(s); if (fdx == i) { result = h; @@ -1166,12 +1164,19 @@ TechDraw::DrawHatch* QGIViewPart::faceIsHatched(int i,std::vector geomObjs) const { TechDraw::DrawGeomHatch* result = nullptr; + bool found = false; for (auto& h:geomObjs) { const std::vector &sourceNames = h->Source.getSubValues(); - int fdx = TechDraw::DrawUtil::getIndexFromName(sourceNames.at(0)); - if (fdx == i) { - result = h; - break; + for (auto& sn: sourceNames) { + int fdx = TechDraw::DrawUtil::getIndexFromName(sn); + if (fdx == i) { + result = h; + found = true; + break; + } + if (found) { + break; + } } } return result;