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:
authorTon Roosendaal <ton@blender.org>2004-06-16 17:31:32 +0400
committerTon Roosendaal <ton@blender.org>2004-06-16 17:31:32 +0400
commit54f9086d3c5a75e92474ec4c6e790f6662793bdf (patch)
tree6dd4ecf5709c4cc3ba8c164801b40e7ac5621c15 /source/blender/src/view.c
parent4091851043d16d82b1f9098d5cb0bf0d5edd4cb3 (diff)
Restored oldstyle zoom in/out, and added a new userpref for denoting zoom
types: - Continue: is default, old style - Dolly: is like previous, but not continuous - Scale: is the new method. Name is based on fact it scales view
Diffstat (limited to 'source/blender/src/view.c')
-rw-r--r--source/blender/src/view.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index ceeff431527..d292f5a310c 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -511,17 +511,28 @@ void viewmove(int mode)
}
}
else if(mode==2) {
- //the old method
- //G.vd->dist*= 1.0+(float)(mvalo[0]-mval[0]+mvalo[1]-mval[1])/1000.0;
- //my method which zooms based on how far you move the mouse
- int ctr[2], len1, len2;
- ctr[0] = (curarea->winrct.xmax + curarea->winrct.xmin)/2;
- ctr[1] = (curarea->winrct.ymax + curarea->winrct.ymin)/2;
-
- len1 = (int)sqrt((ctr[0] - mval[0])*(ctr[0] - mval[0]) + (ctr[1] - mval[1])*(ctr[1] - mval[1])) + 5;
- len2 = (int)sqrt((ctr[0] - mvalo[0])*(ctr[0] - mvalo[0]) + (ctr[1] - mvalo[1])*(ctr[1] - mvalo[1])) + 5;
-
- G.vd->dist= dist0 * ((float)len2/len1);
+ if(U.viewzoom==USER_ZOOM_CONT) {
+ // oldstyle zoom
+ G.vd->dist*= 1.0+(float)(mvalo[0]-mval[0]+mvalo[1]-mval[1])/1000.0;
+ }
+ else if(U.viewzoom==USER_ZOOM_SCALE) {
+ int ctr[2], len1, len2;
+ // method which zooms based on how far you move the mouse
+
+ ctr[0] = (curarea->winrct.xmax + curarea->winrct.xmin)/2;
+ ctr[1] = (curarea->winrct.ymax + curarea->winrct.ymin)/2;
+
+ len1 = (int)sqrt((ctr[0] - mval[0])*(ctr[0] - mval[0]) + (ctr[1] - mval[1])*(ctr[1] - mval[1])) + 5;
+ len2 = (int)sqrt((ctr[0] - mvalo[0])*(ctr[0] - mvalo[0]) + (ctr[1] - mvalo[1])*(ctr[1] - mvalo[1])) + 5;
+
+ G.vd->dist= dist0 * ((float)len2/len1);
+ }
+ else { /* USER_ZOOM_DOLLY */
+ float len1 = (curarea->winrct.ymax - mval[1]) + 5;
+ float len2 = (curarea->winrct.ymax - mvalo[1]) + 5;
+
+ G.vd->dist= dist0 * (2.0*((len2/len1)-1.0) + 1.0);
+ }
/* these limits are in toets.c too */
if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid;