Fixed crash when html file is empty and when canvas fails to aprse

This commit is contained in:
antopilo
2024-09-16 21:42:35 -04:00
parent 7ed37d0bbb
commit c6a2d916a8
4 changed files with 31 additions and 19 deletions

View File

@@ -96,6 +96,11 @@ namespace NuakeUI
static void DrawInspector(std::shared_ptr<Canvas> canvas)
{
if (canvas == nullptr)
{
return;
}
if (ImGui::Begin("Inspector"))
{
if (ImGui::BeginTabBar("MyTabBar"))

View File

@@ -55,15 +55,11 @@ namespace NuakeUI
void Canvas::ComputeLayout(Vector2 size)
{
if (!mRootNode)
if (!mRootNode || mInputManager)
return;
Renderer::Get().SetViewportSize(size);
float x, y;
x = mInputManager->GetMouseX();
y = mInputManager->GetMouseY();
auto root = mRootNode->GetYogaNode();
// Recompute the node tree.