From ec2576d37f5795245710bec8a43f89494cc55654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Mon, 30 Sep 2019 14:55:17 +0200 Subject: [PATCH] Keep GameModel brush radius consistent --- src/gui/game/GameController.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 90efc7371..feb530eac 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -446,11 +446,11 @@ void GameController::AdjustBrushSize(int delta, bool logarithmic, bool xAxis, bo newSize.Y = 200; if(xAxis) - gameModel->GetBrush()->SetRadius(ui::Point(newSize.X, oldSize.Y)); + SetBrushSize(ui::Point(newSize.X, oldSize.Y)); else if(yAxis) - gameModel->GetBrush()->SetRadius(ui::Point(oldSize.X, newSize.Y)); + SetBrushSize(ui::Point(oldSize.X, newSize.Y)); else - gameModel->GetBrush()->SetRadius(newSize); + SetBrushSize(newSize); } void GameController::SetBrushSize(ui::Point newSize) @@ -1582,7 +1582,9 @@ void GameController::Vote(int direction) void GameController::ChangeBrush() { + auto prev_size = gameModel->GetBrush()->GetRadius(); gameModel->SetBrushID(gameModel->GetBrushID()+1); + gameModel->GetBrush()->SetRadius(prev_size); } void GameController::ClearSim()