mirror of
https://github.com/ocornut/imgui.git
synced 2026-04-01 21:17:42 -05:00
AddBezier()->AddBezierCurve(). PathBezierTo()->PathBezierCurveTo(), and reads current point back, more standard (#311)
This commit is contained in:
@@ -665,9 +665,9 @@ static void PathBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1, fl
|
||||
}
|
||||
}
|
||||
|
||||
void ImDrawList::PathBezierTo(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments)
|
||||
void ImDrawList::PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments)
|
||||
{
|
||||
PathLineToMergeDuplicate(p1);
|
||||
ImVec2 p1 = _Path.back();
|
||||
if (num_segments == 0)
|
||||
{
|
||||
// Auto-tessellated
|
||||
@@ -793,6 +793,16 @@ void ImDrawList::AddCircleFilled(const ImVec2& centre, float radius, ImU32 col,
|
||||
PathFill(col);
|
||||
}
|
||||
|
||||
void ImDrawList::AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments)
|
||||
{
|
||||
if ((col >> 24) == 0)
|
||||
return;
|
||||
|
||||
PathLineTo(pos0);
|
||||
PathBezierCurveTo(cp0, cp1, pos1, num_segments);
|
||||
PathStroke(col, false, thickness);
|
||||
}
|
||||
|
||||
void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
|
||||
{
|
||||
if ((col >> 24) == 0)
|
||||
|
||||
Reference in New Issue
Block a user