From 409443500b299a2f2112e669e7085d3f16191e8c Mon Sep 17 00:00:00 2001 From: gsr b3d Date: Wed, 23 Jan 2019 15:31:47 +0100 Subject: UI: fix horizontal scrollbar overlapping last row of files Depending on area size, the scrollbar covered the bottom of the text, with the extra it will only cover the padding at worst. Differential Revision: https://developer.blender.org/D4207 --- source/blender/editors/space_file/filesel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_file/filesel.c') diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index f25d3e25f0b..9a38c16e020 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -76,6 +76,7 @@ #include "UI_interface.h" #include "UI_interface_icons.h" +#include "UI_view2d.h" #include "file_intern.h" #include "filelist.h" @@ -547,7 +548,9 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar) layout->prv_border_y = 0; layout->tile_h = textheight * 3 / 2; layout->height = (int)(BLI_rctf_size_y(&v2d->cur) - 2 * layout->tile_border_y); - layout->rows = layout->height / (layout->tile_h + 2 * layout->tile_border_y); + /* Padding by full scrollbar H is too much, can overlap tile border Y. */ + layout->rows = (layout->height - V2D_SCROLL_HEIGHT + layout->tile_border_y) / + (layout->tile_h + 2 * layout->tile_border_y); column_widths(params, layout); -- cgit v1.2.3