CedricGuillemet / ImGuizmo

Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui
MIT License
3.22k stars 907 forks source link

Gizmo stops responding if window name changes #267

Open FatCatGames opened 2 years ago

FatCatGames commented 2 years ago

Hi, I have this frequent issue where imguizmo stops working randomly while editing the scene. I've pinpointed the issue to being related to the window name.

Here is a video of the issue happening https://drive.google.com/file/d/1sRCdCqJIGjgFF_g7XZyhFRfYtNU05uw5/view?usp=sharing Timestamps: 0:30 0:55 1:34

std::string label = "Scene";
    bool inScene = mySceneManager->GetCurrentScene();
    if (inScene)
    {
        label = mySceneManager->GetCurrentScene()->GetName();
        if (EditorCommandHandler::GetCommandCountSinceSave() > 0) label += "*";
    }

    if (!ImGui::Begin((label + "###SceneWindow").c_str(), 0, ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoScrollbar))
    {
        ImGui::End();
        return;
    }

    ImGuizmo::SetDrawlist(ImGui::GetWindowDrawList());

It does not happen exactly when the name changes, just at random times, but if I comment out the part where the label is changed and just keep it as "Scene", the issue goes away. I would still like to be able to see the scene name and the * if it's unsaved so it would be nice to get help with solving this issue.