Avoid divizion by zero

pull/556/head
Andrei Kortunov 5 years ago
parent 3970baeb84
commit b210e99abc

@ -1418,8 +1418,12 @@ void CSVRender::TerrainShapeMode::setBrushShape(CSVWidget::BrushShape brushShape
selectionCenterY = selectionCenterY + value.second;
++selectionAmount;
}
selectionCenterX = selectionCenterX / selectionAmount;
selectionCenterY = selectionCenterY / selectionAmount;
if (selectionAmount != 0)
{
selectionCenterX /= selectionAmount;
selectionCenterY /= selectionAmount;
}
mCustomBrushShape.clear();
std::pair<int, int> differentialPos {};

Loading…
Cancel
Save