diff --git a/implot.cpp b/implot.cpp index 8a685e1c..fe178c29 100644 --- a/implot.cpp +++ b/implot.cpp @@ -2210,7 +2210,7 @@ template void RenderLineStrip(Getter& getter, ImDraw const ImVec2 uv = DrawList._Data->TexUvWhitePixel; while (segments) { - int cnt = std::min(segments, (int/*todo - remove this cast*/)(((size_t(1) << sizeof(ImDrawIdx) * 8)-1 - DrawList._VtxCurrentIdx) / 4)); // find how many can be reserved up to end of current draw command's limit + int cnt = (int/*todo - remove this cast*/)std::min(size_t(segments), (((size_t(1) << sizeof(ImDrawIdx) * 8)-1 - DrawList._VtxCurrentIdx) / 4)); // find how many can be reserved up to end of current draw command's limit if (cnt >= std::min(64,segments)) { if constexpr ((flags & RenderLineStrip_Cull) != 0) @@ -2234,7 +2234,7 @@ template void RenderLineStrip(Getter& getter, ImDraw segments_culled = 0; } - cnt = std::min(segments, (int/*todo - remove this cast*/)(((size_t(1) << sizeof(ImDrawIdx) * 8) - 1 - 0/*DrawList._VtxCurrentIdx*/) / 4)); + cnt = (int/*todo - remove this cast*/) std::min(size_t(segments), (((size_t(1) << sizeof(ImDrawIdx) * 8) - 1 - 0/*DrawList._VtxCurrentIdx*/) / 4)); DrawList.PrimReserve(cnt * 6, cnt * 4); // reserve new draw command }