diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-09-10 11:24:26 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-09-10 11:24:26 +0400 |
commit | 5cc36bd0dabef2e9b476e57ef5d7e00e1f6c5834 (patch) | |
tree | 7e729a19c387a979a42bbd8fc081157a9647062e /source/blender | |
parent | 90e7bcdc29dcc55a383dc680d6592f0d15e55f11 (diff) |
Bugfix #7294:
When resizing an Outliner window, the contents would eventually get 'pushed out of view' when shrinking the view.
I've added a bit of a 'hack', which will ensure that this doesn't happen, by forcing the view to look at the left-side of the outliner tree, when the width of the outliner window decreses due to resizing.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/drawipo.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 8d841956fd5..c860961639f 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -614,17 +614,23 @@ void test_view2d(View2D *v2d, int winx, int winy) else if( dy > 1.0) do_x= 0; else do_x= 1; } - v2d->oldwinx= winx; - v2d->oldwiny= winy; - if( do_x ) { - - /* portrait window: correct for x */ - dx= cur->ymax-cur->ymin; - temp= (cur->xmax+cur->xmin); - - cur->xmin= temp/2.0 - 0.5*dx/dy; - cur->xmax= temp/2.0 + 0.5*dx/dy; + if (v2d->keeptot == 2 && winx < v2d->oldwinx) { + /* This is a special hack for the outliner, to ensure that the + * outliner contents will not eventually get pushed out of view + * when shrinking the view. + */ + cur->xmax -= cur->xmin; + cur->xmin= 0.0f; + } + else { + /* portrait window: correct for x */ + dx= cur->ymax-cur->ymin; + temp= (cur->xmax+cur->xmin); + + cur->xmin= temp/2.0 - 0.5*dx/dy; + cur->xmax= temp/2.0 + 0.5*dx/dy; + } } else { dx= cur->xmax-cur->xmin; @@ -633,6 +639,9 @@ void test_view2d(View2D *v2d, int winx, int winy) cur->ymin= temp/2.0 - 0.5*dy*dx; cur->ymax= temp/2.0 + 0.5*dy*dx; } + + v2d->oldwinx= winx; + v2d->oldwiny= winy; } if(v2d->keeptot) { @@ -664,6 +673,7 @@ void test_view2d(View2D *v2d, int winx, int winy) cur->xmax+= dx; } else if((v2d->keeptot!=2) && (cur->xmax > tot->xmax)) { + /* keeptot==2 is a special case for the outliner. see space.c, init_v2d_oops for details */ dx= cur->xmax-tot->xmax; cur->xmin-= dx; cur->xmax-= dx; |