-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ImDrawList::AddImageRounded (#1994)
The function makes an assumption that there exists 1 font atlas texture, so that `ImDrawList._Data->TexIdCommon` == `ImDrawList._CmdHeader.TextureId`. Since we support multiple font atlas textures, that assumption is no longer true and `ImDrawList::AddConvexPolyFilled` will create a new draw command as needed, giving `ImGui::ShadeVertsLinearUV` a clean draw command to work with. This workaround forcefully sets *the* font atlas texture to be the texture the user is trying to draw for the duration of drawing polygons and shading those vertices again, so that no draw command change happens. Once the operation is done, font atlas texture is reverted back to what it was. This fix is done without thread safety concerns, but an `ImDrawList` should not be touched from multiple threads at a single time, so this is fine.
- Loading branch information
1 parent
fc7b1f2
commit 23a2bd6
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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