diff options
author | Ton Roosendaal <ton@blender.org> | 2006-11-08 15:46:41 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-11-08 15:46:41 +0300 |
commit | a0354619c77747abe47e4f60a3b26f63f433d40a (patch) | |
tree | 25448d2f46d94662859d47a7f9d9014b93b5a3ee /source | |
parent | 6685c0d571059e1ad84cd4617e18301d9090dbca (diff) |
Patch #5091, by Ramon Carlos Ruiz
For numerical pad 2-4-6-8, it adds a step value in degrees in the User
Presets. Code had to be rewritten some... :)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 8 | ||||
-rw-r--r-- | source/blender/src/space.c | 6 | ||||
-rw-r--r-- | source/blender/src/toets.c | 4 | ||||
-rw-r--r-- | source/blender/src/usiblender.c | 2 |
4 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index f9db4633280..cf970cd9fbf 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -170,13 +170,13 @@ typedef struct UserDef { int textimeout, texcollectrate; int memcachelimit; short frameserverport; - short pad; + short pad_rot_angle; /*control the rotation step of the view when PAD2,PAD4,PAD6&PAD8 is use*/ short obcenter_dia; - short rvisize; /* rotating view icon size */ - short rvibright; /* rotating view icon brightness */ + short rvisize; /* rotating view icon size */ + short rvibright; /* rotating view icon brightness */ char versemaster[160]; char verseuser[160]; - short pad1; + short pad; } UserDef; extern UserDef U; /* from usiblender.c !!!! */ diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 98c392b9d23..a2365cf7e2f 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -2840,7 +2840,11 @@ void drawinfospace(ScrArea *sa, void *spacedata) &U.rvibright, 0, 10, 0, 0, "The brightness of the icon"); uiBlockEndAlign(block); - + + uiDefButS(block, NUM, B_DRAWINFO, "Rotation Angle:", + (xpos+edgsp+(3*mpref)+(4*midsp)),y1,(mpref),buth, + &U.pad_rot_angle, 0, 90, 0, 0, + "The rotation step for numerical pad keys (2 4 6 8)"); uiDefBut(block, LABEL,0,"Select with:", (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth, diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index a9ec10e6114..4f47206006e 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -307,7 +307,7 @@ void persptoetsen(unsigned short event) else if(G.vd->persp<2) { if(event==PAD4 || event==PAD6) { /* z-axis */ - phi= (float)(M_PI/24.0); + phi= (float)(M_PI/360.0)*U.pad_rot_angle; if(event==PAD6) phi= -phi; si= (float)sin(phi); q1[0]= (float)cos(phi); @@ -322,7 +322,7 @@ void persptoetsen(unsigned short event) VECCOPY(q1+1, G.vd->viewinv[0]); Normalise(q1+1); - phi= (float)(M_PI/24.0); + phi= (float)(M_PI/360.0)*U.pad_rot_angle; if(event==PAD2) phi= -phi; si= (float)sin(phi); q1[0]= (float)cos(phi); diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index a0d8a8efca3..92b602b32e0 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -186,6 +186,8 @@ static void init_userdef_file(void) U.tw_size= 20; // percentage of window size U.tw_handlesize= 16; // percentage of widget radius } + if(U.pad_rot_angle==0) + U.pad_rot_angle= 15; if (G.main->versionfile <= 191) { strcpy(U.plugtexdir, U.textudir); |