Fix TextureProgressBar
radial mode invalid polygon edge case
#92901
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.
TextureProgressBar::unit_val_to_uv(float val)
can produce exactly the same UV for almost equal values. Currently subsequent points on the TextureProgressBar's edge mapped to the same UV would be skipped, which can lead to trying to create a 2-point polygon created fromfrom
andcenter
(in caseto
would be skipped because it is close enough tofrom
sounit_val_to_uv(from) == unit_val_to_uv(to)
).godot/scene/gui/texture_progress_bar.cpp
Lines 527 to 531 in 1ce6df7
This PR leaves skipping same-UV points as is, and just ensure
points.size() >= 3
before rendering a polygon.Alternative would be to try improve precision/robustness of
TextureProgressBar::unit_val_to_uv(float val)
but it's probably not needed as the issue happens in an edge case (a super thin triangle which would likely not be rendered anyway).Fixes #92790.