Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2011-09-17 21:18:55 +0400
committerAntony Riakiotakis <kalast@gmail.com>2011-09-17 21:18:55 +0400
commit8e39855b2e6efc42f4696946fba909333dad7aad (patch)
treecd7b951d8122116af5dd5a1a56b8fe8923a233cb /source/blender
parent18735b63126bc6f3e46f9ae6be35debadb3915a2 (diff)
Resurrect the conditional to avoid extra color state changes. Thanks Ender79 for the suggestion!
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c8
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);