From 0eb05b9d25450e487fc5019901a4de8945800a21 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 8 Nov 2004 18:39:09 +0000 Subject: [PATCH] Three cosmetic fixes; - Mesh editmode, draw 'bleeding edges' works again for subsurf (not optimal) - New draw method (again!) for armature-add-bone loop. Should work now! Is also nice for cpu this version - Draw screen edges (black lines inbetween windows) should not draw leftmost --- source/blender/src/drawobject.c | 2 +- source/blender/src/editarmature.c | 21 +++++++++++++++++---- source/blender/src/editscreen.c | 9 +++++---- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 84f2845ad00..bffda80f8f4 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2590,7 +2590,7 @@ static void drawmeshwire_wirextra(DispListMesh *dlm, int optimal, char alpha) /* (bleeding edges) to illustrate selection is defined on vertex basis */ /* but cannot do with subdivided edges... */ - if(dlm==NULL && (G.scene->selectmode & SCE_SELECT_VERTEX)) { + if( (dlm==NULL || optimal==0) && (G.scene->selectmode & SCE_SELECT_VERTEX)) { glShadeModel(GL_SMOOTH); glBegin(GL_LINES); diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 4f6c0d51897..a5a0618fcd4 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -91,6 +91,8 @@ #include "BSE_trans_types.h" #include "BSE_editaction.h" +#include "PIL_time.h" + #include "mydevice.h" #include "blendef.h" #include "nla.h" @@ -1561,7 +1563,7 @@ static void add_bone_input (Object *ob) { float *cursLoc, cent[3], dx, dy; float mat[3][3], curs[3], cmat[3][3], imat[3][3], rmat[4][4], itmat[4][4]; - short xo, yo, mval[2], afbreek=0; + short xo, yo, mval[2], mvalo[2], afbreek=0, drawall; short val; float restmat[4][4], tempVec[4]; EditBone *bone; @@ -1618,9 +1620,10 @@ static void add_bone_input (Object *ob) /* Project cursor center to screenspace. */ getmouseco_areawin(mval); - xo= mval[0]; - yo= mval[1]; + xo= mvalo[0]= mval[0]; + yo= mvalo[1]= mval[1]; window_to_3d(dvecp, xo, yo); + drawall= 2; while (1) { @@ -1687,7 +1690,17 @@ static void add_bone_input (Object *ob) Mat4One (bone->obmat); bone->size[0]=bone->size[1]=bone->size[2]=1.0F; - force_draw_plus(SPACE_BUTS, 1); + /* only draw if... */ + if(drawall) { + drawall--; // draw twice to have 2 identical buffers + force_draw_all(1); + } + else if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { + mvalo[0]= mval[0]; + mvalo[1]= mval[1]; + force_draw(1); + } + else PIL_sleep_ms(10); while(qtest()) { event= extern_qread(&val); diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index a7f2dc197de..93ea0a6c40c 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -3023,10 +3023,11 @@ void drawscredge_area(ScrArea *sa) else sdrawline(x2, y1, x2, y2); /* left border area */ - if(sa->headertype==HEADERTOP) sdrawline(x1, y1, x1, y2-SCR_ROUND+1); - else if(sa->headertype==HEADERDOWN) sdrawline(x1, y1+SCR_ROUND-1, x1, y2); - else sdrawline(x1, y1, x1, y2); - + if(x1>0) { // otherwise it draws the emboss of window over + if(sa->headertype==HEADERTOP) sdrawline(x1, y1, x1, y2-SCR_ROUND+1); + else if(sa->headertype==HEADERDOWN) sdrawline(x1, y1+SCR_ROUND-1, x1, y2); + else sdrawline(x1, y1, x1, y2); + } /* top border area */ if(sa->headertype==HEADERTOP) sdrawline(x1+SCR_ROUND, y2, x2-SCR_ROUND+1, y2); else sdrawline(x1, y2, x2, y2);