Fix T45133: Crash drawing material buttons
This commit is contained in:
parent
63f62cd757
commit
c119187be0
Notes:
blender-bot
2023-02-14 11:35:46 +01:00
Referenced by issue #45215, New Material Creation causes Error: EXCEPTION_ACCESS_VIOLATION Referenced by issue #45133, Crash when clicking materials tab in properties panel
|
@ -1111,7 +1111,13 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
|
|||
*/
|
||||
|
||||
/* turn on alpha-blending */
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
if (GLEW_VERSION_1_4) {
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
else {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
/* draw! */
|
||||
|
|
|
@ -1228,7 +1228,13 @@ static void icon_draw_size(
|
|||
if (!pi->rect[size]) return; /* something has gone wrong! */
|
||||
|
||||
/* preview images use premul alpha ... */
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
if (GLEW_VERSION_1_4) {
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
else {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
icon_draw_rect(x, y, w, h, aspect, pi->w[size], pi->h[size], pi->rect[size], alpha, rgb, is_preview);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue