Skip to content

Commit 1f58a24

Browse files
authored
Fix ImGui assertions in built game UI (#753)
1 parent 60bbe46 commit 1f58a24

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

Sources/OvUI/include/OvUI/Core/UIManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ namespace OvUI::Core
152152
private:
153153
OvWindowing::Window& m_window;
154154
OvTools::Eventing::ListenerID m_contentScaleChangedListener;
155-
bool m_dockingState;
155+
bool m_dockingState = false;
156156
Styling::EStyle m_currentStyle;
157-
float m_scale;
158-
bool m_dpiAware;
157+
float m_scale = 1.0f;
158+
bool m_dpiAware = false;
159159
bool m_refreshStyle = false;
160160
Modules::Canvas* m_currentCanvas = nullptr;
161161
std::unordered_map<std::string, ImFont*> m_fonts;

Sources/OvUI/src/OvUI/Panels/PanelUndecorated.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,17 @@
1111
void OvUI::Panels::PanelUndecorated::_Draw_Impl()
1212
{
1313
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 0, 0 });
14-
ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, { 0, 0 });
14+
ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, { 1.0f, 1.0f });
1515

1616
if (ImGui::Begin(m_panelID.c_str(), nullptr, CollectFlags()))
1717
{
18-
ImGui::PopStyleVar(2);
19-
2018
Update();
21-
22-
DrawWidgets();
2319

24-
ImGui::End();
25-
}
26-
else
27-
{
28-
ImGui::PopStyleVar(2);
20+
DrawWidgets();
2921
}
22+
23+
ImGui::End();
24+
ImGui::PopStyleVar(2);
3025
}
3126

3227
int OvUI::Panels::PanelUndecorated::CollectFlags()

0 commit comments

Comments
 (0)