[Bf-committers] Separate Patches for Bug and Style Changes as per Developer Documentation

Nathanael Law bf-committers@blender.org
Wed, 17 Dec 2003 00:12:01 -0700


--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I just found the developer documentation on the www.blender.org
website.  As per the instructions on submitting patches, I have
separated the patch for the bug fix (bug ID 760) and the
code style corrections to the changes in revision 1.49 of
editobject.c.

I hope this did not inconvenience anyone.

-- 
 - Nathanael Law <njlaw@xyrodian.com>


--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="CodeStyle.diff"

Index: source/blender/src/editobject.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editobject.c,v
retrieving revision 1.49
diff -u -r1.49 editobject.c
--- source/blender/src/editobject.c	17 Dec 2003 04:27:29 -0000	1.49
+++ source/blender/src/editobject.c	17 Dec 2003 07:04:49 -0000
@@ -5097,13 +5097,13 @@
 					else{
 						axismode= XTRANS;
 					}
-                    if (mode == 'g') {
-                            if (axismode & XTRANS)
-                                    ax = 0;
-                    } else if (mode == 's') {
-                            if (axismode & XTRANS)
-                                    ax = 1;
-                    }
+					if (mode == 'g') {
+						if (axismode & XTRANS)
+							ax = 0;
+					} else if (mode == 's') {
+						if (axismode & XTRANS)
+							ax = 1;
+					}
 					firsttime=1;
 					break;
 					
@@ -5115,13 +5115,13 @@
 					else{
 						axismode= YTRANS;
 					}
-                    if (mode == 'g') {
-                            if (axismode & YTRANS)
-                                    ax = 1;
-                    } else if (mode == 's') {
-                            if (axismode & YTRANS)
-                                    ax = 2;
-                    }
+					if (mode == 'g') {
+						if (axismode & YTRANS)
+							ax = 1;
+					} else if (mode == 's') {
+						if (axismode & YTRANS)
+							ax = 2;
+					}
 					firsttime=1;
 					break;
 					
@@ -5133,13 +5133,13 @@
 					else{
 						axismode= ZTRANS;
 					}
-                    if (mode == 'g') {
-                            if (axismode & ZTRANS)
-                                    ax = 2;
-                    } else if (mode == 's') {
-                            if (axismode & ZTRANS)
-                                    ax = 3;
-                    }
+					if (mode == 'g') {
+						if (axismode & ZTRANS)
+							ax = 2;
+					} else if (mode == 's') {
+						if (axismode & ZTRANS)
+							ax = 3;
+					}
 					firsttime=1;
 					break;
 				case WHEELDOWNMOUSE:
@@ -5280,8 +5280,8 @@
 						if ((mode == 'S') || (mode == 'w') || (mode == 'C') || (mode == 'N'))
 							break;
 						if ((mode != 'r') && (mode != 'R')){
-                            if (axismode != 0)
-                                    break;
+							if (axismode != 0)
+								break;
 							ax += 1;
 							if (mode == 's'){
 								if (ax == 4){ax=0;}
@@ -5329,12 +5329,12 @@
 						typemode = 1;
 						del = 0;
 						if (mode == 's'){
-                            if (axismode & XTRANS)
-                                    ax = 1;
-                            if (axismode & YTRANS)
-                                    ax = 2;
-                            if (axismode & ZTRANS)
-                                    ax = 3;
+							if (axismode & XTRANS)
+								ax = 1;
+							if (axismode & YTRANS)
+								ax = 2;
+							if (axismode & ZTRANS)
+								ax = 3;
 							if (ax == 0){
 								if (pe[0]){
 									int div = 1;
@@ -5406,12 +5406,12 @@
 							}
 						}
 						else{
-                            if (axismode & XTRANS)
-                                    ax = 0;
-                            if (axismode & YTRANS)
-                                    ax = 1;
-                            if (axismode & ZTRANS)
-                                    ax = 2;
+							if (axismode & XTRANS)
+								ax = 0;
+							if (axismode & YTRANS)
+								ax = 1;
+							if (axismode & ZTRANS)
+								ax = 2;
 							if (pe[ax]){
 								int div = 1;
 								int i;

--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="Bug760Fix.diff"

Index: source/blender/src/editobject.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editobject.c,v
retrieving revision 1.49
diff -u -r1.49 editobject.c
--- source/blender/src/editobject.c	17 Dec 2003 04:27:29 -0000	1.49
+++ source/blender/src/editobject.c	17 Dec 2003 07:05:16 -0000
@@ -3979,6 +3979,7 @@
 	int	keyflags = 0;
 
 	float addvec[3] = {0,0,0}; // for new typing code
+	short szchange[3] = {0,0,0}; // for code to use default size of 1.0
 	short ax = 0, del = 0, typemode = 0; // also for new typing thingy
 	short pe[3] = {0,0,0}; // again for the same thing. Determines if the period key has been pressed.
 	short mi[3] = {1,1,1}; // same thing again. Determines whether or not the minus key has been pressed (in order to add or substract new numbers).
@@ -4697,10 +4698,13 @@
 				}
 				else size[0]=size[1]=size[2]= (sqrt( (float)((yc-mval[1])*(yc-mval[1])+(mval[0]-xc)*(mval[0]-xc)) ))/sizefac;
 				
-				if (typemode){
-					size[0] = addvec[0];
-					size[1] = addvec[1];
-					size[2] = addvec[2];
+				if (typemode) {
+					if (szchange[0] == 0) size[0] = 1.0;
+					else size[0] = addvec[0];
+					if (szchange[1] == 0) size[1] = 1.0;
+					else size[1] = addvec[1];
+					if (szchange[2] == 0) size[2] = 1.0;
+					else size[2] = addvec[2];
 				}
 
 				if(axismode && mode=='s') {
@@ -5194,18 +5198,22 @@
 								addvec[0]=addvec[1]=addvec[2]=0;
 								pe[0]=pe[1]=pe[2]=0;
 								mi[0]=mi[1]=mi[2]=1;
+								szchange[0] = szchange[1] = szchange[2] = 0;
 							}
 							else if (del == 1){
 								addvec[0]=addvec[1]=addvec[2]=0;
 								pe[0]=pe[1]=pe[2]=0;
 								mi[0]=mi[1]=mi[2]=1;
 								del = 0;
+								if (mode == 's')
+									szchange[0] = szchange[1] = szchange[2] = 0;
 							}
 							else if (mode == 's'){
 								addvec[ax-1]=0;
 								pe[ax-1]=0;
 								mi[ax-1]=1;
 								del = 1;
+								szchange[ax-1] = 0;
 							}
 							else if ((mode == 'r') || (mode == 'R')){
 								phi -= M_PI * addvec[ax] / 180;
@@ -5355,6 +5363,7 @@
 									addvec[2] *= 10;
 									addvec[2] += mi[2] * add_num;
 								}
+								szchange[0] = szchange[1] = szchange[2] = 1;
 							}
 							else{
 								if (pe[ax-1]){
@@ -5368,6 +5377,7 @@
 									addvec[ax-1] *= 10;
 									addvec[ax-1] += mi[ax-1] * add_num;
 								}
+								szchange[ax-1] = 1;
 							}
 							
 						}

--fdj2RfSjLxBAspz7--