<commit_before>#include "TextWidget.hpp"
#include <iostream>

gsf::TextWidget::TextWidget()
{

}

gsf::TextWidget::TextWidget(std::string text, sf::Font &font)
{
    init(text, font, 12, sf::Color::Black);
}

gsf::TextWidget::TextWidget(std::string text, sf::Font &font, int characterSize)
{
    init(text, font, characterSize, sf::Color::Black);
}

gsf::TextWidget::TextWidget(std::string text, sf::Font &font, int characterSize, sf::Color color)
{
    init(text, font, characterSize, color);
}

void gsf::TextWidget::init(std::string text, sf::Font &font, int characterSize, sf::Color color)
{
    m_text.setString(text);
    m_text.setFont(font);
	m_text.setCharacterSize(characterSize);
	m_text.setColor(color);
	calculateSize();
}

gsf::TextWidget::~TextWidget()
{

}
/*
sf::Text& gsf::TextWidget::getText()
{
    return m_text;
}
*/
void gsf::TextWidget::setText(const std::string text)
{
    m_text.setString(text);
}

std::string gsf::TextWidget::getText() const
{
    return m_text.getString().toAnsiString();
}

void gsf::TextWidget::setCharacterSize(const unsigned int size)
{
    m_text.setCharacterSize(size);
    calculateSize();
    centerOrigin();
}

unsigned int gsf::TextWidget::getCharacterSize() const
{
    return m_text.getCharacterSize();
}

void gsf::TextWidget::setTextColor(const sf::Color color)<commit_msg>Adjust size after text change<commit_after>#include "TextWidget.hpp"
#include <iostream>

gsf::TextWidget::TextWidget()
{

}

gsf::TextWidget::TextWidget(std::string text, sf::Font &font)
{
    init(text, font, 12, sf::Color::Black);
}

gsf::TextWidget::TextWidget(std::string text, sf::Font &font, int characterSize)
{
    init(text, font, characterSize, sf::Color::Black);
}

gsf::TextWidget::TextWidget(std::string text, sf::Font &font, int characterSize, sf::Color color)
{
    init(text, font, characterSize, color);
}

void gsf::TextWidget::init(std::string text, sf::Font &font, int characterSize, sf::Color color)
{
    m_text.setString(text);
    m_text.setFont(font);
	m_text.setCharacterSize(characterSize);
	m_text.setColor(color);
	calculateSize();
}

gsf::TextWidget::~TextWidget()
{

}
/*
sf::Text& gsf::TextWidget::getText()
{
    return m_text;
}
*/
void gsf::TextWidget::setText(const std::string text)
{
    m_text.setString(text);
    calculateSize();
    centerOrigin();
}

std::string gsf::TextWidget::getText() const
{
    return m_text.getString().toAnsiString();
}

void gsf::TextWidget::setCharacterSize(const unsigned int size)
{
    m_text.setCharacterSize(size);
    calculateSize();
    centerOrigin();
}

unsigned int gsf::TextWidget::getCharacterSize() const
{
    return m_text.getCharacterSize();
}

void gsf::TextWidget::setTextColor(const sf::Color color)
{'fraction_non_alphanumeric': 0.1651376146788991, 'fraction_numerical': 0.0014678899082568807, 'mean_word_length': 6.269333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2052210', 'n_tokens_mistral': 943, 'n_tokens_neox': 942, 'n_words': 169}