Skip to content

Commit

Permalink
Keep GameModel brush radius consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
LBPHacker committed Sep 30, 2019
1 parent 024c3c1 commit ec2576d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/game/GameController.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ec2576d

Please sign in to comment.