From 6e133a4bbad472dc03215acd6a22b0211c30a6f3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 7 Aug 2024 00:36:54 +0200 Subject: Fix: widget alignment is uninitialized --- src/gui/List.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui') diff --git a/src/gui/List.cpp b/src/gui/List.cpp index 0c5f78e..1e81b83 100644 --- a/src/gui/List.cpp +++ b/src/gui/List.cpp @@ -85,6 +85,7 @@ namespace gsr { offset.x = floor(size.x * 0.5f - widget->get_size().x * 0.5f); else offset.x = 0.0f; + widget->set_position(draw_pos + offset); if(widget.get() != selected_widget) widget->draw(window, mgl::vec2f(0.0f, 0.0f)); @@ -99,6 +100,7 @@ namespace gsr { if(content_alignment == Alignment::CENTER) offset.y = floor(size.y * 0.5f - widget->get_size().y * 0.5f); + widget->set_position(draw_pos + offset); if(widget.get() != selected_widget) widget->draw(window, mgl::vec2f(0.0f, 0.0f)); -- cgit v1.2.3