mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 12:39:55 +00:00
Avoid divizion by zero
This commit is contained in:
parent
3970baeb84
commit
b210e99abc
@ -1418,8 +1418,12 @@ void CSVRender::TerrainShapeMode::setBrushShape(CSVWidget::BrushShape brushShape
|
|||||||
selectionCenterY = selectionCenterY + value.second;
|
selectionCenterY = selectionCenterY + value.second;
|
||||||
++selectionAmount;
|
++selectionAmount;
|
||||||
}
|
}
|
||||||
selectionCenterX = selectionCenterX / selectionAmount;
|
|
||||||
selectionCenterY = selectionCenterY / selectionAmount;
|
if (selectionAmount != 0)
|
||||||
|
{
|
||||||
|
selectionCenterX /= selectionAmount;
|
||||||
|
selectionCenterY /= selectionAmount;
|
||||||
|
}
|
||||||
|
|
||||||
mCustomBrushShape.clear();
|
mCustomBrushShape.clear();
|
||||||
std::pair<int, int> differentialPos {};
|
std::pair<int, int> differentialPos {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user