Fix T49090 - NW broke some color wheel drawing

Thanks to @Severin for help on IRC :)
This commit is contained in:
Greg Zaal 2016-08-19 16:05:11 +02:00
parent 3621a22469
commit f65ecafa4a
Notes: blender-bot 2023-02-14 19:45:25 +01:00
Referenced by issue #49090, color picker broken
1 changed files with 5 additions and 1 deletions

View File

@ -742,6 +742,9 @@ def store_mouse_cursor(context, event):
def draw_line(x1, y1, x2, y2, size, colour=[1.0, 1.0, 1.0, 0.7]):
shademodel_state = bgl.Buffer(bgl.GL_INT, 1)
bgl.glGetIntegerv(bgl.GL_SHADE_MODEL, shademodel_state)
bgl.glEnable(bgl.GL_BLEND)
bgl.glLineWidth(size * dpifac())
bgl.glShadeModel(bgl.GL_SMOOTH)
@ -756,7 +759,8 @@ def draw_line(x1, y1, x2, y2, size, colour=[1.0, 1.0, 1.0, 0.7]):
except:
pass
bgl.glEnd()
bgl.glShadeModel(bgl.GL_FLAT)
bgl.glShadeModel(shademodel_state[0])
bgl.glDisable(bgl.GL_LINE_SMOOTH)