[TD]Fix #4017 Crash on bad hatch scale
This commit is contained in:
@@ -517,6 +517,7 @@ void QGIFace::buildSvgHatch()
|
||||
before.append(QString::fromStdString(SVGCOLPREFIX + SVGCOLDEFAULT));
|
||||
after.append(QString::fromStdString(SVGCOLPREFIX + m_svgCol));
|
||||
QByteArray colorXML = m_svgXML.replace(before,after);
|
||||
long int tileCount = 0;
|
||||
for (int iw = 0; iw < int(nw); iw++) {
|
||||
for (int ih = 0; ih < int(nh); ih++) {
|
||||
QGCustomSvg* tile = new QGCustomSvg();
|
||||
@@ -525,6 +526,14 @@ void QGIFace::buildSvgHatch()
|
||||
tile->setParentItem(m_rect);
|
||||
tile->setPos(iw*wTile,-h + ih*hTile);
|
||||
}
|
||||
tileCount++;
|
||||
if (tileCount > m_maxTile) {
|
||||
Base::Console().Warning("SVG tile count exceeded: %ld\n",tileCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (tileCount > m_maxTile) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -611,6 +620,10 @@ void QGIFace::getParameters(void)
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");
|
||||
|
||||
m_maxSeg = hGrp->GetInt("MaxSeg",10000l);
|
||||
|
||||
hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
|
||||
m_maxTile = hGrp->GetInt("MaxSVGTile",10000l);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user