mirror of
https://github.com/ocornut/imgui.git
synced 2024-12-05 06:57:13 +08:00
Demo: Commented out ideas on another way to center a window.
This commit is contained in:
parent
e1d7e14717
commit
7538bbabb6
@ -2923,8 +2923,11 @@ static void ShowDemoWindowPopups()
|
|||||||
ImGui::OpenPopup("Delete?");
|
ImGui::OpenPopup("Delete?");
|
||||||
|
|
||||||
// Always center this window when appearing
|
// Always center this window when appearing
|
||||||
ImGuiViewport* viewport = ImGui::GetMainViewport();
|
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||||
ImGui::SetNextWindowPos(viewport->GetCenter(), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
|
//ImVec2 parent_pos = ImGui::GetWindowPos();
|
||||||
|
//ImVec2 parent_size = ImGui::GetWindowSize();
|
||||||
|
//ImVec2 center(parent_pos.x + parent_size.x * 0.5f, parent_pos.y + parent_size.y * 0.5f);
|
||||||
|
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
|
||||||
|
|
||||||
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
|
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user