MCPcopy Create free account
hub / github.com/RenderKit/embree / PathBezierCubicCurveTo

Method PathBezierCubicCurveTo

tutorials/common/imgui/imgui_draw.cpp:1280–1294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1278}
1279
1280void ImDrawList::PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments)
1281{
1282 ImVec2 p1 = _Path.back();
1283 if (num_segments == 0)
1284 {
1285 IM_ASSERT(_Data->CurveTessellationTol > 0.0f);
1286 PathBezierCubicCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
1287 }
1288 else
1289 {
1290 float t_step = 1.0f / (float)num_segments;
1291 for (int i_step = 1; i_step <= num_segments; i_step++)
1292 _Path.push_back(ImBezierCubicCalc(p1, p2, p3, p4, t_step * i_step));
1293 }
1294}
1295
1296void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments)
1297{

Callers

nothing calls this directly

Calls 3

ImBezierCubicCalcFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected