fix: Disable ImGui assert that causes random crashes on resize
This commit is contained in:
parent
f3e6d35c98
commit
c749d6a7dc
2
lib/third_party/imgui/imgui/source/imgui.cpp
vendored
2
lib/third_party/imgui/imgui/source/imgui.cpp
vendored
@ -15592,7 +15592,7 @@ void ImGui::SetCurrentViewport(ImGuiWindow* current_window, ImGuiViewportP* view
|
|||||||
return;
|
return;
|
||||||
g.CurrentDpiScale = viewport ? viewport->DpiScale : 1.0f;
|
g.CurrentDpiScale = viewport ? viewport->DpiScale : 1.0f;
|
||||||
g.CurrentViewport = viewport;
|
g.CurrentViewport = viewport;
|
||||||
IM_ASSERT(g.CurrentDpiScale > 0.0f && g.CurrentDpiScale < 99.0f); // Typical correct values would be between 1.0f and 4.0f
|
//IM_ASSERT(g.CurrentDpiScale > 0.0f && g.CurrentDpiScale < 99.0f); // Typical correct values would be between 1.0f and 4.0f
|
||||||
//IMGUI_DEBUG_LOG_VIEWPORT("[viewport] SetCurrentViewport changed '%s' 0x%08X\n", current_window ? current_window->Name : NULL, viewport ? viewport->ID : 0);
|
//IMGUI_DEBUG_LOG_VIEWPORT("[viewport] SetCurrentViewport changed '%s' 0x%08X\n", current_window ? current_window->Name : NULL, viewport ? viewport->ID : 0);
|
||||||
|
|
||||||
// Notify platform layer of viewport changes
|
// Notify platform layer of viewport changes
|
||||||
|
@ -529,17 +529,18 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::string localizedName = name.get();
|
||||||
if (currPopup->isModal())
|
if (currPopup->isModal())
|
||||||
createPopup(ImGui::BeginPopupModal(name, closeButton, flags));
|
createPopup(ImGui::BeginPopupModal(localizedName.c_str(), closeButton, flags));
|
||||||
else
|
else
|
||||||
createPopup(ImGui::BeginPopup(name, flags));
|
createPopup(ImGui::BeginPopup(localizedName.c_str(), flags));
|
||||||
|
|
||||||
if (!ImGui::IsPopupOpen(name) && displayFrameCount < 5) {
|
if (!ImGui::IsPopupOpen(localizedName.c_str()) && displayFrameCount < 5) {
|
||||||
ImGui::OpenPopup(name);
|
ImGui::OpenPopup(localizedName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currPopup->shouldClose() || !open) {
|
if (currPopup->shouldClose() || !open) {
|
||||||
log::debug("Closing popup '{}'", name);
|
log::debug("Closing popup '{}'", localizedName);
|
||||||
positionSet = sizeSet = false;
|
positionSet = sizeSet = false;
|
||||||
|
|
||||||
currPopup = nullptr;
|
currPopup = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user