bug fix: float precision overflow in IM_NORMALIZE2F_OVER_ZERO - #6331
Open
InJoins wants to merge 1 commit into
Open
bug fix: float precision overflow in IM_NORMALIZE2F_OVER_ZERO#6331InJoins wants to merge 1 commit into
InJoins wants to merge 1 commit into
Conversation
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
Author
|
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. |
Owner
|
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);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) |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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