small change to deselectall, just made it so that pressing Akey didnt do anything...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Apr 2006 08:19:28 +0000 (08:19 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Apr 2006 08:19:28 +0000 (08:19 +0000)
notice that if you pressed Akey when no objects in the view it still pushed an undo event, redrew and counted all and change the memory usage in the status.
mainly added not to waist undo slots.

source/blender/src/editview.c

index ea640897963d6966e7d7c88e7371771fcbf7d15b..1dd01a1ba59ff45dab0d35246d7b13dcf8dd8165 100644 (file)
@@ -867,17 +867,24 @@ void mouse_cursor(void)
 void deselectall(void) /* is toggle */
 {
        Base *base;
 void deselectall(void) /* is toggle */
 {
        Base *base;
-       int a=0;
+       int a=0, ok=0; 
 
        base= FIRSTBASE;
        while(base) {
 
        base= FIRSTBASE;
        while(base) {
+               /* is there a visible selected object */
                if TESTBASE(base) {
                if TESTBASE(base) {
-                       a= 1;
+                       ok= a= 1;
                        break;
                }
                        break;
                }
+               /* are there any objects in the view*/
+               if(base->lay & G.vd->lay)
+                       ok=1;
+               
                base= base->next;
        }
        
                base= base->next;
        }
        
+       if (!ok) return;
+       
        base= FIRSTBASE;
        while(base) {
                if(base->lay & G.vd->lay) {
        base= FIRSTBASE;
        while(base) {
                if(base->lay & G.vd->lay) {