Skip to content

Commit

Permalink
fix division by zero in RendererShaded
Browse files Browse the repository at this point in the history
  • Loading branch information
epezent committed Aug 20, 2023
1 parent a2632b9 commit 4330220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion implot_items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ struct RendererShaded : RendererBase {
return false;
}
const int intersect = (P11.y > P12.y && P22.y > P21.y) || (P12.y > P11.y && P21.y > P22.y);
ImVec2 intersection = Intersection(P11,P21,P12,P22);
const ImVec2 intersection = intersect == 0 ? ImVec2(0,0) : Intersection(P11,P21,P12,P22);
draw_list._VtxWritePtr[0].pos = P11;
draw_list._VtxWritePtr[0].uv = UV;
draw_list._VtxWritePtr[0].col = Col;
Expand Down

0 comments on commit 4330220

Please sign in to comment.