Fixed crash when html file is empty and when canvas fails to aprse
This commit is contained in:
@@ -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"))
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user