From 01cdd22a524b0f4a51d52d661268eb3758c68f35 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Apr 2016 15:47:49 +1000 Subject: Fix alpha blending w/ font drawing & byte buffer --- source/blender/blenfont/intern/blf_font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 7c6bef57aa4..dfebaecb96e 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -411,7 +411,7 @@ static void blf_font_draw_buffer_ex( cbuf[0] = (unsigned char)((b_col_char[0] * a) + (cbuf[0] * (1.0f - a))); cbuf[1] = (unsigned char)((b_col_char[1] * a) + (cbuf[1] * (1.0f - a))); cbuf[2] = (unsigned char)((b_col_char[2] * a) + (cbuf[2] * (1.0f - a))); - cbuf[3] = (unsigned char)((alphatest = ((int)cbuf[3] + (int)(a * 255)) < 255) ? + cbuf[3] = (unsigned char)(((alphatest = ((int)cbuf[3] + (int)(a * 255))) < 255) ? alphatest : 255); } } -- cgit v1.2.3