From 55b3fd441809fe691b0d803b4c300463b0aa81b0 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Wed, 25 Sep 2019 13:01:52 +0300 Subject: [PATCH] Use float calculations for circle brush, keep tool options in memory. --- apps/opencs/view/render/terrainshapemode.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/opencs/view/render/terrainshapemode.cpp b/apps/opencs/view/render/terrainshapemode.cpp index e5daf7a9f..3420149a5 100644 --- a/apps/opencs/view/render/terrainshapemode.cpp +++ b/apps/opencs/view/render/terrainshapemode.cpp @@ -80,12 +80,6 @@ void CSVRender::TerrainShapeMode::activate(CSVWidget::SceneToolbar* toolbar) void CSVRender::TerrainShapeMode::deactivate(CSVWidget::SceneToolbar* toolbar) { - if(mShapeBrushScenetool) - { - toolbar->removeTool (mShapeBrushScenetool); - delete mShapeBrushScenetool; - mShapeBrushScenetool = 0; - } EditMode::deactivate(toolbar); } @@ -429,7 +423,7 @@ void CSVRender::TerrainShapeMode::editTerrainShapeGrid(const std::pair cellCoords = CSMWorld::CellCoordinates::fromId(cellId).first; int distanceX = abs(i - vertexCoords.first); 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 y = CSMWorld::CellCoordinates::vertexGlobalToInCellCoords(j); float distancePerRadius = 1.0f * distance / r;