mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-05 22:15:45 +01:00
imgui_freetype: fixed undefined float to integer conversion when de-multiplying a color glyph with a color above its alpha. (#9599)
This commit is contained in:
parent
391f714c37
commit
7ee4dbac89
@ -295,7 +295,7 @@ static void ImGui_ImplFreeType_BlitGlyph(const FT_Bitmap* ft_bitmap, uint32_t* d
|
|||||||
case FT_PIXEL_MODE_BGRA:
|
case FT_PIXEL_MODE_BGRA:
|
||||||
{
|
{
|
||||||
// FIXME: Converting pre-multiplied alpha to straight. Doesn't smell good.
|
// FIXME: Converting pre-multiplied alpha to straight. Doesn't smell good.
|
||||||
#define DE_MULTIPLY(color, alpha) ImMin((ImU32)(255.0f * (float)color / (float)(alpha + FLT_MIN) + 0.5f), 255u)
|
#define DE_MULTIPLY(color, alpha) (ImU32)ImMin(255.0f * (float)color / (float)(alpha + FLT_MIN) + 0.5f, 255.0f)
|
||||||
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)
|
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)
|
||||||
for (uint32_t x = 0; x < w; x++)
|
for (uint32_t x = 0; x < w; x++)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user