mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Fix: widget alignment is uninitialized
This commit is contained in:
@@ -51,8 +51,8 @@ namespace gsr {
|
||||
Widget *parent_widget = nullptr;
|
||||
Widget *selected_child_widget = nullptr;
|
||||
|
||||
Alignment horizontal_aligment;
|
||||
Alignment vertical_aligment;
|
||||
Alignment horizontal_aligment = Alignment::START;
|
||||
Alignment vertical_aligment = Alignment::START;
|
||||
|
||||
bool visible = true;
|
||||
};
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user