Skip to content

Commit 4d8e839

Browse files
committed
Renamed ImDrawList::AddBezierCurve() to ImDrawList::AddBezierCubic(), ImDrawList::PathBezierCurveTo() to ImDrawList::PathBezierCubicCurveTo(). (ocornut#3127, ocornut#3664, ocornut#3665)
Renamed corresponding internal functions as well.
1 parent 550bfcf commit 4d8e839

File tree

6 files changed

+69
-67
lines changed

6 files changed

+69
-67
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Breaking Changes:
3939

4040
- Added imgui_tables.cpp file! Manually constructed project files will need the new file added!
4141
- Backends: moved all backends files (imgui_impl_XXXX.cpp, imgui_impl_XXXX.h) from examples/ to backends/. (#3513)
42+
- Renamed ImDrawList::AddBezierCurve() to ImDrawList::AddBezierCubic(). Kept inline redirection function (will obsolete).
43+
- Renamed ImDrawList::PathBezierCurveTo() to ImDrawList::PathBezierCubicCurveTo(). Kept inline redirection function (will obsolete).
4244
- Removed redirecting functions/enums names that were marked obsolete in 1.60 (April 2017):
4345
- io.RenderDrawListsFn pointer -> use ImGui::GetDrawData() value and call the render function of your backend
4446
- ImGui::IsAnyWindowFocused() -> use ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow)

imgui.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ CODE
371371
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
372372
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
373373

374+
- 2020/12/21 (1.80) - renamed ImDrawList::AddBezierCurve() to AddBezierCubic(), and PathBezierCurveTo() to PathBezierCubicCurveTo(). Kept inline redirection function (will obsolete).
374375
- 2020/12/04 (1.80) - added imgui_tables.cpp file! Manually constructed project files will need the new file added!
375376
- 2020/11/18 (1.80) - renamed undocumented/internals ImGuiColumnsFlags_* to ImGuiOldColumnFlags_* in prevision of incoming Tables API.
376377
- 2020/11/03 (1.80) - renamed io.ConfigWindowsMemoryCompactTimer to io.ConfigMemoryCompactTimer as the feature will apply to other data structures
@@ -1120,7 +1121,7 @@ void ImGuiIO::ClearInputCharacters()
11201121
// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)
11211122
//-----------------------------------------------------------------------------
11221123

1123-
ImVec2 ImBezierClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments)
1124+
ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments)
11241125
{
11251126
IM_ASSERT(num_segments > 0); // Use ImBezierClosestPointCasteljau()
11261127
ImVec2 p_last = p1;
@@ -1129,7 +1130,7 @@ ImVec2 ImBezierClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3
11291130
float t_step = 1.0f / (float)num_segments;
11301131
for (int i_step = 1; i_step <= num_segments; i_step++)
11311132
{
1132-
ImVec2 p_current = ImBezierCalc(p1, p2, p3, p4, t_step * i_step);
1133+
ImVec2 p_current = ImBezierCubicCalc(p1, p2, p3, p4, t_step * i_step);
11331134
ImVec2 p_line = ImLineClosestPoint(p_last, p_current, p);
11341135
float dist2 = ImLengthSqr(p - p_line);
11351136
if (dist2 < p_closest_dist2)
@@ -1143,7 +1144,7 @@ ImVec2 ImBezierClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3
11431144
}
11441145

11451146
// Closely mimics PathBezierToCasteljau() in imgui_draw.cpp
1146-
static void BezierClosestPointCasteljauStep(const ImVec2& p, ImVec2& p_closest, ImVec2& p_last, float& p_closest_dist2, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)
1147+
static void ImBezierCubicClosestPointCasteljauStep(const ImVec2& p, ImVec2& p_closest, ImVec2& p_last, float& p_closest_dist2, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)
11471148
{
11481149
float dx = x4 - x1;
11491150
float dy = y4 - y1;
@@ -1171,20 +1172,20 @@ static void BezierClosestPointCasteljauStep(const ImVec2& p, ImVec2& p_closest,
11711172
float x123 = (x12 + x23)*0.5f, y123 = (y12 + y23)*0.5f;
11721173
float x234 = (x23 + x34)*0.5f, y234 = (y23 + y34)*0.5f;
11731174
float x1234 = (x123 + x234)*0.5f, y1234 = (y123 + y234)*0.5f;
1174-
BezierClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1, y1, x12, y12, x123, y123, x1234, y1234, tess_tol, level + 1);
1175-
BezierClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1234, y1234, x234, y234, x34, y34, x4, y4, tess_tol, level + 1);
1175+
ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1, y1, x12, y12, x123, y123, x1234, y1234, tess_tol, level + 1);
1176+
ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1234, y1234, x234, y234, x34, y34, x4, y4, tess_tol, level + 1);
11761177
}
11771178
}
11781179

11791180
// tess_tol is generally the same value you would find in ImGui::GetStyle().CurveTessellationTol
11801181
// Because those ImXXX functions are lower-level than ImGui:: we cannot access this value automatically.
1181-
ImVec2 ImBezierClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol)
1182+
ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol)
11821183
{
11831184
IM_ASSERT(tess_tol > 0.0f);
11841185
ImVec2 p_last = p1;
11851186
ImVec2 p_closest;
11861187
float p_closest_dist2 = FLT_MAX;
1187-
BezierClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, tess_tol, 0);
1188+
ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, tess_tol, 0);
11881189
return p_closest;
11891190
}
11901191

imgui.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,8 +2357,8 @@ struct ImDrawList
23572357
IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
23582358
IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, bool closed, float thickness);
23592359
IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); // Note: Anti-aliased filling requires points to be in clockwise order.
2360-
IMGUI_API void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0); // Cubic Bezier (4 control points)
2361-
IMGUI_API void AddQuadBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments = 0); // Quadratic Bezier (3 control points)
2360+
IMGUI_API void AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0); // Cubic Bezier (4 control points)
2361+
IMGUI_API void AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments = 0); // Quadratic Bezier (3 control points)
23622362

23632363
// Image primitives
23642364
// - Read FAQ to understand what ImTextureID is.
@@ -2376,8 +2376,8 @@ struct ImDrawList
23762376
inline void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness); _Path.Size = 0; }
23772377
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 10);
23782378
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
2379-
IMGUI_API void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0); // Cubic Bezier (4 control points)
2380-
IMGUI_API void PathQuadBezierCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments = 0); // Quadratic Bezier (3 control points)
2379+
IMGUI_API void PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0); // Cubic Bezier (4 control points)
2380+
IMGUI_API void PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments = 0); // Quadratic Bezier (3 control points)
23812381
IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
23822382

23832383
// Advanced
@@ -2407,6 +2407,11 @@ struct ImDrawList
24072407
inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
24082408
inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } // Write vertex with unique index
24092409

2410+
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
2411+
inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); }
2412+
inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); }
2413+
#endif
2414+
24102415
// [Internal helpers]
24112416
IMGUI_API void _ResetForNewFrame();
24122417
IMGUI_API void _ClearFreeMemory();

imgui_demo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6963,11 +6963,11 @@ static void ShowExampleAppCustomRendering(bool* p_open)
69636963

69646964
// Quadratic Bezier Curve (3 control points)
69656965
ImVec2 cp3[3] = { ImVec2(x, y + sz * 0.6f), ImVec2(x + sz * 0.5f, y - sz * 0.4f), ImVec2(x + sz, y + sz) };
6966-
draw_list->AddQuadBezierCurve(cp3[0], cp3[1], cp3[2], col, th, curve_segments); x += sz + spacing;
6966+
draw_list->AddBezierQuadratic(cp3[0], cp3[1], cp3[2], col, th, curve_segments); x += sz + spacing;
69676967

69686968
// Cubic Bezier Curve (4 control points)
69696969
ImVec2 cp4[4] = { ImVec2(x, y), ImVec2(x + sz * 1.3f, y + sz * 0.3f), ImVec2(x + sz - sz * 1.3f, y + sz - sz * 0.3f), ImVec2(x + sz, y + sz) };
6970-
draw_list->AddBezierCurve(cp4[0], cp4[1], cp4[2], cp4[3], col, th, curve_segments);
6970+
draw_list->AddBezierCubic(cp4[0], cp4[1], cp4[2], cp4[3], col, th, curve_segments);
69716971

69726972
x = p.x + 4;
69736973
y += sz + spacing;

imgui_draw.cpp

Lines changed: 44 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,20 +1050,27 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa
10501050
}
10511051
}
10521052

1053-
// Cubic bezier
1054-
ImVec2 ImBezierCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t)
1053+
ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t)
10551054
{
10561055
float u = 1.0f - t;
1057-
float w1 = u*u*u;
1058-
float w2 = 3*u*u*t;
1059-
float w3 = 3*u*t*t;
1060-
float w4 = t*t*t;
1061-
return ImVec2(w1*p1.x + w2*p2.x + w3*p3.x + w4*p4.x, w1*p1.y + w2*p2.y + w3*p3.y + w4*p4.y);
1056+
float w1 = u * u * u;
1057+
float w2 = 3 * u * u * t;
1058+
float w3 = 3 * u * t * t;
1059+
float w4 = t * t * t;
1060+
return ImVec2(w1 * p1.x + w2 * p2.x + w3 * p3.x + w4 * p4.x, w1 * p1.y + w2 * p2.y + w3 * p3.y + w4 * p4.y);
10621061
}
10631062

1064-
// Cubic bezier
1065-
// Closely mimics BezierClosestPointCasteljauStep() in imgui.cpp
1066-
static void PathBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)
1063+
ImVec2 ImBezierQuadraticCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t)
1064+
{
1065+
float u = 1.0f - t;
1066+
float w1 = u * u;
1067+
float w2 = 2 * u * t;
1068+
float w3 = t * t;
1069+
return ImVec2(w1 * p1.x + w2 * p2.x + w3 * p3.x, w1 * p1.y + w2 * p2.y + w3 * p3.y);
1070+
}
1071+
1072+
// Closely mimics ImBezierCubicClosestPointCasteljau() in imgui.cpp
1073+
static void PathBezierCubicCurveToCasteljau(ImVector<ImVec2>* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)
10671074
{
10681075
float dx = x4 - x1;
10691076
float dy = y4 - y1;
@@ -1083,39 +1090,12 @@ static void PathBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1, fl
10831090
float x123 = (x12 + x23) * 0.5f, y123 = (y12 + y23) * 0.5f;
10841091
float x234 = (x23 + x34) * 0.5f, y234 = (y23 + y34) * 0.5f;
10851092
float x1234 = (x123 + x234) * 0.5f, y1234 = (y123 + y234) * 0.5f;
1086-
PathBezierToCasteljau(path, x1, y1, x12, y12, x123, y123, x1234, y1234, tess_tol, level + 1);
1087-
PathBezierToCasteljau(path, x1234, y1234, x234, y234, x34, y34, x4, y4, tess_tol, level + 1);
1088-
}
1089-
}
1090-
1091-
// Cubic bezier
1092-
void ImDrawList::PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments)
1093-
{
1094-
ImVec2 p1 = _Path.back();
1095-
if (num_segments == 0)
1096-
{
1097-
PathBezierToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
1098-
}
1099-
else
1100-
{
1101-
float t_step = 1.0f / (float)num_segments;
1102-
for (int i_step = 1; i_step <= num_segments; i_step++)
1103-
_Path.push_back(ImBezierCalc(p1, p2, p3, p4, t_step * i_step));
1093+
PathBezierCubicCurveToCasteljau(path, x1, y1, x12, y12, x123, y123, x1234, y1234, tess_tol, level + 1);
1094+
PathBezierCubicCurveToCasteljau(path, x1234, y1234, x234, y234, x34, y34, x4, y4, tess_tol, level + 1);
11041095
}
11051096
}
11061097

1107-
// Quadratic bezier
1108-
ImVec2 ImQuadBezierCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t)
1109-
{
1110-
float u = 1.0f - t;
1111-
float w1 = u * u;
1112-
float w2 = 2 * u * t;
1113-
float w3 = t * t;
1114-
return ImVec2(w1 * p1.x + w2 * p2.x + w3 * p3.x, w1 * p1.y + w2 * p2.y + w3 * p3.y);
1115-
}
1116-
1117-
// Quadratic bezier
1118-
static void PathQuadBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1, float x2, float y2, float x3, float y3, float tess_tol, int level)
1098+
static void PathBezierQuadraticCurveToCasteljau(ImVector<ImVec2>* path, float x1, float y1, float x2, float y2, float x3, float y3, float tess_tol, int level)
11191099
{
11201100
float dx = x3 - x1, dy = y3 - y1;
11211101
float det = (x2 - x3) * dy - (y2 - y3) * dx;
@@ -1128,24 +1108,38 @@ static void PathQuadBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1
11281108
float x12 = (x1 + x2) * 0.5f, y12 = (y1 + y2) * 0.5f;
11291109
float x23 = (x2 + x3) * 0.5f, y23 = (y2 + y3) * 0.5f;
11301110
float x123 = (x12 + x23) * 0.5f, y123 = (y12 + y23) * 0.5f;
1131-
PathQuadBezierToCasteljau(path, x1, y1, x12, y12, x123, y123, tess_tol, level + 1);
1132-
PathQuadBezierToCasteljau(path, x123, y123, x23, y23, x3, y3, tess_tol, level + 1);
1111+
PathBezierQuadraticCurveToCasteljau(path, x1, y1, x12, y12, x123, y123, tess_tol, level + 1);
1112+
PathBezierQuadraticCurveToCasteljau(path, x123, y123, x23, y23, x3, y3, tess_tol, level + 1);
1113+
}
1114+
}
1115+
1116+
void ImDrawList::PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments)
1117+
{
1118+
ImVec2 p1 = _Path.back();
1119+
if (num_segments == 0)
1120+
{
1121+
PathBezierCubicCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
1122+
}
1123+
else
1124+
{
1125+
float t_step = 1.0f / (float)num_segments;
1126+
for (int i_step = 1; i_step <= num_segments; i_step++)
1127+
_Path.push_back(ImBezierCubicCalc(p1, p2, p3, p4, t_step * i_step));
11331128
}
11341129
}
11351130

1136-
// Quadratic bezier
1137-
void ImDrawList::PathQuadBezierCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments)
1131+
void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3, int num_segments)
11381132
{
11391133
ImVec2 p1 = _Path.back();
11401134
if (num_segments == 0)
11411135
{
1142-
PathQuadBezierToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
1136+
PathBezierQuadraticCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, _Data->CurveTessellationTol, 0);// Auto-tessellated
11431137
}
11441138
else
11451139
{
11461140
float t_step = 1.0f / (float)num_segments;
11471141
for (int i_step = 1; i_step <= num_segments; i_step++)
1148-
_Path.push_back(ImQuadBezierCalc(p1, p2, p3, t_step * i_step));
1142+
_Path.push_back(ImBezierQuadraticCalc(p1, p2, p3, t_step * i_step));
11491143
}
11501144
}
11511145

@@ -1359,24 +1353,24 @@ void ImDrawList::AddNgonFilled(const ImVec2& center, float radius, ImU32 col, in
13591353
}
13601354

13611355
// Cubic Bezier takes 4 controls points
1362-
void ImDrawList::AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments)
1356+
void ImDrawList::AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments)
13631357
{
13641358
if ((col & IM_COL32_A_MASK) == 0)
13651359
return;
13661360

13671361
PathLineTo(p1);
1368-
PathBezierCurveTo(p2, p3, p4, num_segments);
1362+
PathBezierCubicCurveTo(p2, p3, p4, num_segments);
13691363
PathStroke(col, false, thickness);
13701364
}
13711365

13721366
// Quadratic Bezier takes 3 controls points
1373-
void ImDrawList::AddQuadBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments)
1367+
void ImDrawList::AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments)
13741368
{
13751369
if ((col & IM_COL32_A_MASK) == 0)
13761370
return;
13771371

13781372
PathLineTo(p1);
1379-
PathQuadBezierCurveTo(p2, p3, num_segments);
1373+
PathBezierQuadraticCurveTo(p2, p3, num_segments);
13801374
PathStroke(col, false, thickness);
13811375
}
13821376

imgui_internal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,10 @@ static inline float ImLinearSweep(float current, float target, float speed)
396396
static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
397397

398398
// Helpers: Geometry
399-
IMGUI_API ImVec2 ImBezierCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t); // Cubic Bezier
400-
IMGUI_API ImVec2 ImBezierClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments); // For curves with explicit number of segments
401-
IMGUI_API ImVec2 ImBezierClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol);// For auto-tessellated curves you can use tess_tol = style.CurveTessellationTol
402-
IMGUI_API ImVec2 ImQuadBezierCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t); // Quadratic Bezier
399+
IMGUI_API ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t);
400+
IMGUI_API ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments); // For curves with explicit number of segments
401+
IMGUI_API ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float tess_tol);// For auto-tessellated curves you can use tess_tol = style.CurveTessellationTol
402+
IMGUI_API ImVec2 ImBezierQuadraticCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t);
403403
IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p);
404404
IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);
405405
IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);

0 commit comments

Comments
 (0)