bug fix: float precision overflow in IM_NORMALIZE2F_OVER_ZERO
when added vertices are particularly dense or close together, sometimes the resulting lines will crack, flicker, or even cover the entire screen, causing the screen to flicker Since a root-splitting calculation will be performed later, 0.001 is appropriate
affected functions: AddPolyline, AddConvexPolyFilled
Since the added points are in the unit of screen pixels, two consecutive points in a polyline with a distance of sqrt(0.001)=0.0316 pixels have no effect on the final accuracy and display effect as a single point.
Hello,
Could you post repro of shapes that are noticeably affected?
If I try:
ImDrawList* draw_list = ImGui::GetForegroundDrawList();
draw_list->PathLineTo(ImVec2(100, 100));
draw_list->PathLineTo(ImVec2(200, 100));
draw_list->PathLineTo(ImVec2(200, 100.00001f));
draw_list->PathLineTo(ImVec2(100, 300.0f));
draw_list->PathStroke(IM_COL32_WHITE, 0, 3.0f);
Original code:
Yours:
I'd be interested to see how your case behave with #2964 because my case behave well with it (branch: https://github.com/ocornut/imgui/tree/features/potocpav-newer-lines-2)
Ref #4053, #3366 for similar change in the other macro.