Skip to content

Commit 11bd1a2

Browse files
committed
ImDrawList: New AddPolyline() implementation (fixup)
1 parent 8d6a28e commit 11bd1a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

imgui_draw.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2577,13 +2577,13 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
25772577
const int arc_count = (round_join ? points_count - (polyline.closed ? 0 : 1) : 0) + (!polyline.closed && round_cap ? 2 : 0);
25782578

25792579
#if defined(IMGUI_ENABLE_SSE)
2580-
#define IM_POLYLINE_TMP_BUFFER_ROUND_UP(count, size) (((count) * (size) + sizeof(__m128) - 1) / sizeof(ImVec2))
2580+
#define IM_POLYLINE_TEMP_BUFFER_ROUND_UP(count, size) (((count) * (size) + sizeof(__m128) - 1) / sizeof(ImVec2))
25812581
#else
2582-
#define IM_POLYLINE_TMP_BUFFER_ROUND_UP(count, size) (count)
2582+
#define IM_POLYLINE_TEMP_BUFFER_ROUND_UP(count, size) (count)
25832583
#endif
25842584

2585-
const int normal_count = IM_POLYLINE_TMP_BUFFER_ROUND_UP(points_count, sizeof(ImVec2));
2586-
const int segment_length_sqr_count = IM_POLYLINE_TMP_BUFFER_ROUND_UP(points_count + 1, sizeof(float));
2585+
const int normal_count = IM_POLYLINE_TEMP_BUFFER_ROUND_UP(points_count, sizeof(ImVec2));
2586+
const int segment_length_sqr_count = IM_POLYLINE_TEMP_BUFFER_ROUND_UP(points_count + 1, sizeof(float));
25872587

25882588
this->_Data->TempBuffer.reserve_discard(normal_count + segment_length_sqr_count + arc_count * sizeof(ImDrawListPolylineArc) / 3); // 'count' normals and 'count + 1 + 1 (to round up)' segment lengths
25892589
ImVec2* normals = this->_Data->TempBuffer.Data;

0 commit comments

Comments
 (0)