diff options
author | Ton Roosendaal <ton@blender.org> | 2004-04-07 20:09:22 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-04-07 20:09:22 +0400 |
commit | 5c1331f081b40a8082bd304e67cee90e14fd0bb0 (patch) | |
tree | 702bec722e9c10dc0fbbb65429bef6b15acc06dd | |
parent | 1923c6f41b5b55f082202fd3858afe788f25b4d5 (diff) |
bug fix #953
This more of a quality issue... changes now are:
- in (ortho) 3d view, changing window aspect keeps zooming
level (it zoomed out with extreme portrait aspect)
- pressing 'home' in 3d window now shows all with extreme aspect ratios too
-rw-r--r-- | source/blender/src/view.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c index cfd7d54607c..3c2c47cdb52 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -598,13 +598,15 @@ void setwinmatrixview3d(rctf *rect) /* rect: for picking */ dfac= near/d; - /* if(G.vd->persp==1 && G.vd->dproj>1.0) far= G.vd->dproj*far; */ - if(G.vd->persp==0) { - /* x1= -winx*G.vd->dist/1000.0; */ - x1= -G.vd->dist; + if(winx>winy) x1= -G.vd->dist; + else x1= -winx*G.vd->dist/winy; + x2= -x1; - y1= -winy*G.vd->dist/winx; + + if(winx>winy) y1= -winy*G.vd->dist/winx; + else y1= -G.vd->dist; + y2= -y1; orth= 1; } @@ -1087,6 +1089,13 @@ void view3d_home(int centre) G.vd->dist= size; + // correction for window aspect ratio + if(curarea->winy>2 && curarea->winx>2) { + size= (float)curarea->winx/(float)curarea->winy; + if(size<1.0) size= 1.0/size; + G.vd->dist*= size; + } + if(G.vd->persp==2) G.vd->persp= 1; scrarea_queue_winredraw(curarea); |