diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-28 16:10:23 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-28 16:10:23 +0400 |
commit | 0356b92d4627885248aed7f39a3e20b267f2e8f7 (patch) | |
tree | 3ff5fceb691b65cabb0bde7da1d358fa19468687 /source/blender/editors/interface/view2d.c | |
parent | 996c767071fb1ce757e29bfdb5d9a98cac76623b (diff) |
File Browser fixes:
* The code to draw only visible items was not working, giving slow
performance with many files (bug #19469).
* Fix detailed list display on non-windows, would give overlapping text.
* Fix folders with many files not displaying all items, changed short to
int in various places, was overflowing.
* Recreate layout on area resizes, file view gets out of sync otherwise.
* Workaround for v2d height not being correct with image display due to
scrollers.
* Fix view2d code to compute minimum scroller size, this would make the
scroller go outside of its bounds.
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 2da491e488d..f7546e94f86 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -831,6 +831,7 @@ void UI_view2d_totRect_set_resize (View2D *v2d, int width, int height, int resiz height= abs(height); /* hrumf! */ + /* XXX: there are work arounds for this in the panel and file browse code. */ if(scroll & V2D_SCROLL_HORIZONTAL) width -= V2D_SCROLL_WIDTH; if(scroll & V2D_SCROLL_VERTICAL) @@ -1397,8 +1398,14 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short if (scrollers->hor_min > scrollers->hor_max) scrollers->hor_min= scrollers->hor_max; /* prevent sliders from being too small, and disappearing */ - if ((scrollers->hor_max - scrollers->hor_min) < V2D_SCROLLER_HANDLE_SIZE) - scrollers->hor_max+= V2D_SCROLLER_HANDLE_SIZE; + if ((scrollers->hor_max - scrollers->hor_min) < V2D_SCROLLER_HANDLE_SIZE) { + scrollers->hor_max= scrollers->hor_min + V2D_SCROLLER_HANDLE_SIZE; + + if(scrollers->hor_max > hor.xmax) { + scrollers->hor_max= hor.xmax; + scrollers->hor_min= MAX2(scrollers->hor_max - V2D_SCROLLER_HANDLE_SIZE, hor.xmin); + } + } /* check whether sliders can disappear */ if(v2d->keeptot) { @@ -1429,8 +1436,14 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short if (scrollers->vert_min > scrollers->vert_max) scrollers->vert_min= scrollers->vert_max; /* prevent sliders from being too small, and disappearing */ - if ((scrollers->vert_max - scrollers->vert_min) < V2D_SCROLLER_HANDLE_SIZE) - scrollers->vert_max+= V2D_SCROLLER_HANDLE_SIZE; + if ((scrollers->vert_max - scrollers->vert_min) < V2D_SCROLLER_HANDLE_SIZE) { + scrollers->vert_max= scrollers->vert_min + V2D_SCROLLER_HANDLE_SIZE; + + if(scrollers->vert_max > vert.ymax) { + scrollers->vert_max= vert.ymax; + scrollers->vert_min= MAX2(scrollers->vert_max - V2D_SCROLLER_HANDLE_SIZE, vert.ymin); + } + } /* check whether sliders can disappear */ if(v2d->keeptot) { |