From 8430c884510c2c88b68ad1dd054d37e55bd14e1c Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 28 Aug 2015 14:41:10 +0100 Subject: [PATCH] Demo: added a bezier curve in the old custom rendering demo. --- imgui_demo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index cd8d9dbd..195f7222 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -1645,6 +1645,9 @@ static void ShowExampleAppCustomRendering(bool* opened) if (canvas_size.y < 50.0f) canvas_size.y = 50.0f; draw_list->AddRectFilledMultiColor(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), ImColor(0,0,0), ImColor(255,0,0), ImColor(255,255,0), ImColor(0,255,0)); draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), ImColor(255,255,255)); + + draw_list->AddBezierCurve(ImVec2(canvas_pos.x+20,canvas_pos.y+20), ImVec2(canvas_pos.x+100,canvas_pos.y+20), ImVec2(canvas_pos.x+canvas_size.x-100,canvas_pos.y+canvas_size.y-20), ImVec2(canvas_pos.x+canvas_size.x-20,canvas_pos.y+canvas_size.y-20), ImColor(255,200,0), 5.0f); + bool adding_preview = false; ImGui::InvisibleButton("canvas", canvas_size); if (ImGui::IsItemHovered())