diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2011-09-17 21:18:55 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2011-09-17 21:18:55 +0400 |
commit | 8e39855b2e6efc42f4696946fba909333dad7aad (patch) | |
tree | cd7b951d8122116af5dd5a1a56b8fe8923a233cb | |
parent | 18735b63126bc6f3e46f9ae6be35debadb3915a2 (diff) |
Resurrect the conditional to avoid extra color state changes. Thanks Ender79 for the suggestion!
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 89a2381ea2f..112c2312c0f 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -684,7 +684,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glColor4ubv((unsigned char *)col2); if(me->drawflag & ME_DRAWEDGES) { - int sel; + int sel, lastsel = -1; UI_GetThemeColor4ubv(TH_VERTEX_SELECT, col1); if(interpedges) { @@ -715,8 +715,10 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glBegin(GL_LINES); BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { sel = (uvedit_edge_selected(em, scene, l)? 1 : 0); - glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2); - + if(sel != lastsel){ + glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2); + lastsel = sel; + } luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); glVertex2fv(luv->uv); luv = CustomData_bmesh_get(&em->bm->ldata, l->next->head.data, CD_MLOOPUV); |