diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-11 19:00:03 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-11 19:26:54 +0300 |
commit | 6abbab5b5396a84a8f3169135f5937d76d3dcb6f (patch) | |
tree | 3a82a38243cc19a1c184fee430d3ae44773d05d8 /source/blender | |
parent | a1764cedbde0d0564214f26e7fcc027cfefb1467 (diff) |
Fix T60415: wrong font preview image alpha blending.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 4b2486f2a68..93e10704c0c 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -391,8 +391,10 @@ static void file_draw_preview( UI_GetThemeColor4fv(TH_TEXT, col); } - /* Preview images use premultiplied alpha. */ - GPU_blend_set_func_separate(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + if (!is_icon && typeflags & FILE_TYPE_BLENDERLIB) { + /* Datablock preview images use premultiplied alpha. */ + GPU_blend_set_func_separate(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + } IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR); immDrawPixelsTexScaled(&state, (float)xco, (float)yco, imb->x, imb->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST, imb->rect, |