Skip to content

Commit

Permalink
config tool: use correct brush size when clearing in config mode
Browse files Browse the repository at this point in the history
  • Loading branch information
krawthekrow committed Jul 21, 2018
1 parent 7ae6f13 commit f3fc2d0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/gui/game/ConfigTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,29 +393,54 @@ void ConfigTool::ReleaseTool::Click(Simulation *sim, Brush *brush, ui::Point pos
if (configTool->IsConfiguring())
configTool->Reset();
else
{
ui::Point oldSize = brush->GetRadius();
brush->SetRadius(ui::Point(0, 0));
clearTool->Click(sim, brush, position);
brush->SetRadius(oldSize);
}
}

void ConfigTool::ReleaseTool::Draw(Simulation * sim, Brush * brush, ui::Point position)
{
if (!configTool->IsConfiguring())
{
ui::Point oldSize = brush->GetRadius();
brush->SetRadius(ui::Point(0, 0));
clearTool->Draw(sim, brush, position);
brush->SetRadius(oldSize);
}
}

void ConfigTool::ReleaseTool::DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging)
{
if (!configTool->IsConfiguring())
{
ui::Point oldSize = brush->GetRadius();
brush->SetRadius(ui::Point(0, 0));
clearTool->DrawLine(sim, brush, position1, position2, dragging);
brush->SetRadius(oldSize);
}
}

void ConfigTool::ReleaseTool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2)
{
if (!configTool->IsConfiguring())
{
ui::Point oldSize = brush->GetRadius();
brush->SetRadius(ui::Point(0, 0));
clearTool->DrawRect(sim, brush, position1, position2);
brush->SetRadius(oldSize);
}
}

void ConfigTool::ReleaseTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position)
{
if (!configTool->IsConfiguring())
{
ui::Point oldSize = brush->GetRadius();
brush->SetRadius(ui::Point(0, 0));
clearTool->DrawFill(sim, brush, position);
brush->SetRadius(oldSize);
}
}

0 comments on commit f3fc2d0

Please sign in to comment.