Skip to content

Commit eca3337

Browse files
committed
more cleanup
1 parent 3126e6c commit eca3337

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/game_menu_impl.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,10 @@ namespace game_menu
7272

7373
void Menu::WriteText(const std::string& str, const sf::Font& font, const float& size, const sf::Vector2f& position, const sf::Color& color)
7474
{
75-
sf::Text text;
76-
text.setString(str);
77-
text.setFont(font);
75+
sf::Text text(str, font, size);
7876
text.setFillColor(color);
79-
text.setCharacterSize(size);
8077
const auto halfTextBoxWidth = text.getLocalBounds().width / 2.0f;
81-
text.setOrigin(halfTextBoxWidth, 0);
78+
text.setOrigin(halfTextBoxWidth, 0); // TODO: Is this necessary?
8279

8380
auto textX = position.x;
8481
if (textX - halfTextBoxWidth < 0)

0 commit comments

Comments
 (0)