From d251204564a28ab090ef6423d48a4baaf7aa4d0d Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 8 Mar 2015 12:09:57 +0000 Subject: [PATCH] ShowTestWindow: fixed "undo" button of custom rendering applet + default size --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 8e18d01f..7791730b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9230,6 +9230,7 @@ static void ShowExampleAppManipulatingWindowTitle(bool* opened) static void ShowExampleAppCustomRendering(bool* opened) { + ImGui::SetNextWindowSize(ImVec2(300,350), ImGuiSetCond_FirstUseEver); if (!ImGui::Begin("Example: Custom Rendering", opened)) { ImGui::End(); @@ -9244,7 +9245,7 @@ static void ShowExampleAppCustomRendering(bool* opened) static ImVector points; static bool adding_line = false; if (ImGui::Button("Clear")) points.clear(); - if (points.size() > 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) points.pop_back(); } + if (points.size() >= 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) { points.pop_back(); points.pop_back(); } } ImGui::Text("Left-click and drag to add lines"); ImGui::Text("Right-click to undo");