| 1278 | } |
| 1279 | |
| 1280 | void 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 | |
| 1296 | void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments) |
| 1297 | { |
nothing calls this directly
no test coverage detected