1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 11:23:51 +00:00

Use float calculations for circle brush, keep tool options in memory.

This commit is contained in:
Nelsson Huotari 2019-09-25 13:01:52 +03:00
parent 62d50a1f47
commit 55b3fd4418

View file

@ -80,12 +80,6 @@ void CSVRender::TerrainShapeMode::activate(CSVWidget::SceneToolbar* toolbar)
void CSVRender::TerrainShapeMode::deactivate(CSVWidget::SceneToolbar* toolbar) void CSVRender::TerrainShapeMode::deactivate(CSVWidget::SceneToolbar* toolbar)
{ {
if(mShapeBrushScenetool)
{
toolbar->removeTool (mShapeBrushScenetool);
delete mShapeBrushScenetool;
mShapeBrushScenetool = 0;
}
EditMode::deactivate(toolbar); EditMode::deactivate(toolbar);
} }
@ -429,7 +423,7 @@ void CSVRender::TerrainShapeMode::editTerrainShapeGrid(const std::pair<int, int>
cellCoords = CSMWorld::CellCoordinates::fromId(cellId).first; cellCoords = CSMWorld::CellCoordinates::fromId(cellId).first;
int distanceX = abs(i - vertexCoords.first); int distanceX = abs(i - vertexCoords.first);
int distanceY = abs(j - vertexCoords.second); int distanceY = abs(j - vertexCoords.second);
int distance = std::round(sqrt(pow(distanceX, 2)+pow(distanceY, 2))); float distance = sqrt(pow(distanceX, 2)+pow(distanceY, 2));
int x = CSMWorld::CellCoordinates::vertexGlobalToInCellCoords(i); int x = CSMWorld::CellCoordinates::vertexGlobalToInCellCoords(i);
int y = CSMWorld::CellCoordinates::vertexGlobalToInCellCoords(j); int y = CSMWorld::CellCoordinates::vertexGlobalToInCellCoords(j);
float distancePerRadius = 1.0f * distance / r; float distancePerRadius = 1.0f * distance / r;