|
|
|
@ -7130,7 +7130,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
|
|
|
|
static bool curve_segments_override = false;
|
|
|
|
|
static int curve_segments_override_v = 8;
|
|
|
|
|
static ImVec4 colf = ImVec4(1.0f, 1.0f, 0.4f, 1.0f);
|
|
|
|
|
ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f");
|
|
|
|
|
ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 100.0f, "%.0f");
|
|
|
|
|
ImGui::DragFloat("Thickness", &thickness, 0.05f, 1.0f, 8.0f, "%.02f");
|
|
|
|
|
ImGui::SliderInt("N-gon sides", &ngon_sides, 3, 12);
|
|
|
|
|
ImGui::Checkbox("##circlesegmentoverride", &circle_segments_override);
|
|
|
|
@ -7147,6 +7147,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
|
|
|
|
const ImDrawCornerFlags corners_none = 0;
|
|
|
|
|
const ImDrawCornerFlags corners_all = ImDrawCornerFlags_All;
|
|
|
|
|
const ImDrawCornerFlags corners_tl_br = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotRight;
|
|
|
|
|
const float rounding = sz / 5.0f;
|
|
|
|
|
const int circle_segments = circle_segments_override ? circle_segments_override_v : 0;
|
|
|
|
|
const int curve_segments = curve_segments_override ? curve_segments_override_v : 0;
|
|
|
|
|
float x = p.x + 4.0f;
|
|
|
|
@ -7158,8 +7159,8 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
|
|
|
|
draw_list->AddNgon(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, ngon_sides, th); x += sz + spacing; // N-gon
|
|
|
|
|
draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, circle_segments, th); x += sz + spacing; // Circle
|
|
|
|
|
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f, corners_none, th); x += sz + spacing; // Square
|
|
|
|
|
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_all, th); x += sz + spacing; // Square with all rounded corners
|
|
|
|
|
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_tl_br, th); x += sz + spacing; // Square with two rounded corners
|
|
|
|
|
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, corners_all, th); x += sz + spacing; // Square with all rounded corners
|
|
|
|
|
draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, rounding, corners_tl_br, th); x += sz + spacing; // Square with two rounded corners
|
|
|
|
|
draw_list->AddTriangle(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col, th);x += sz + spacing; // Triangle
|
|
|
|
|
//draw_list->AddTriangle(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col, th);x+= sz*0.4f + spacing; // Thin triangle
|
|
|
|
|
draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!)
|
|
|
|
|