Browse Source

imgui_freetype: fixed divide by zero while handling FT_PIXEL_MODE_BGRA glyphs. (#7267, #3369)

pull/7762/head
ocornut 4 months ago
parent
commit
50a0f18e6a
  1. 1
      docs/CHANGELOG.txt
  2. 2
      misc/freetype/imgui_freetype.cpp

1
docs/CHANGELOG.txt

@ -93,6 +93,7 @@ Other changes:
- Debug Tools: Metrics/Debugger: Browsing a Storage perform hover lookup on identifier.
- Viewports: Backported 'void* ImGuiViewport::PlatformHandle' from docking branch for
use by backends.
- imgui_freetype: Fixed divide by zero while handling FT_PIXEL_MODE_BGRA glyphs. (#7267, #3369)
- Backends: OpenGL2, OpenGL3: ImGui_ImplOpenGL3_NewFrame() recreates font texture if it
has been destroyed by ImGui_ImplOpenGL3_DestroyFontsTexture(). (#7748) [@mlauss2]
- Backends: SDL3: Update for API removal of keysym field in SDL_KeyboardEvent. (#7728)

2
misc/freetype/imgui_freetype.cpp

@ -357,7 +357,7 @@ namespace
case FT_PIXEL_MODE_BGRA:
{
// FIXME: Converting pre-multiplied alpha to straight. Doesn't smell good.
#define DE_MULTIPLY(color, alpha) (ImU32)(255.0f * (float)color / (float)alpha + 0.5f)
#define DE_MULTIPLY(color, alpha) ImMin((ImU32)(255.0f * (float)color / (float)(alpha + FLT_MIN) + 0.5f), 255u)
if (multiply_table == nullptr)
{
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)

Loading…
Cancel
Save