[TD]Fix #4017 Crash on bad hatch scale

This commit is contained in:
wandererfan
2019-07-18 20:12:28 -04:00
committed by WandererFan
parent 82dd7f0344
commit 21efae348e
4 changed files with 34 additions and 7 deletions

View File

@@ -386,7 +386,10 @@ void QGIViewPart::drawViewPart()
}
newFace->isHatched(true);
newFace->setFillMode(QGIFace::GeomHatchFill);
newFace->setHatchScale(fGeom->ScalePattern.getValue());
double hatchScale = fGeom->ScalePattern.getValue();
if (hatchScale > 0.0) {
newFace->setHatchScale(fGeom->ScalePattern.getValue());
}
newFace->setHatchFile(fGeom->FilePattern.getValue());
Gui::ViewProvider* gvp = QGIView::getViewProvider(fGeom);
ViewProviderGeomHatch* geomVp = dynamic_cast<ViewProviderGeomHatch*>(gvp);
@@ -404,7 +407,10 @@ void QGIViewPart::drawViewPart()
Gui::ViewProvider* gvp = QGIView::getViewProvider(fHatch);
ViewProviderHatch* hatchVp = dynamic_cast<ViewProviderHatch*>(gvp);
if (hatchVp != nullptr) {
newFace->setHatchScale(hatchVp->HatchScale.getValue());
double hatchScale = hatchVp->HatchScale.getValue();
if (hatchScale > 0.0) {
newFace->setHatchScale(hatchVp->HatchScale.getValue());
}
newFace->setHatchColor(hatchVp->HatchColor.getValue());
}
}