Moved common functionality and includes around

This commit is contained in:
2025-12-08 15:31:43 +02:00
parent df4ead9f85
commit 3a52a3991c
4 changed files with 10 additions and 13 deletions

View File

@@ -30,10 +30,6 @@ m_halign(halign),
m_valign(valign),
m_text_color(text_color)
{
if (nullptr != m_surface)
{
SDL_SetSurfaceBlendMode(m_surface, SDL_BLENDMODE_BLEND);
}
}
WidgetText::WidgetText(int x, int y, int width, int height, string text,
@@ -49,10 +45,6 @@ m_halign(HALIGN_CENTER),
m_valign(VALIGN_CENTER),
m_text_color{.r = 0, .g = 0, .b = 0, .a = SDL_ALPHA_OPAQUE}
{
if (nullptr != m_surface)
{
SDL_SetSurfaceBlendMode(m_surface, SDL_BLENDMODE_BLEND);
}
}
WidgetText::WidgetText(int x, int y, int width, int height, string text,
@@ -66,10 +58,6 @@ m_halign(HALIGN_CENTER),
m_valign(VALIGN_CENTER),
m_text_color{.r = 0, .g = 0, .b = 0, .a = SDL_ALPHA_OPAQUE}
{
if (nullptr != m_surface)
{
SDL_SetSurfaceBlendMode(m_surface, SDL_BLENDMODE_BLEND);
}
}
void WidgetText::set_text(const string& text)