Fix #124168: Allow File Browser Layout Initialization While Minimized

If you change an area to a File Browser while it is vertically
minimized we get an assert on layout initialization since there
are no visible rows. But this state is valid and it works great
without this assert. This PR removes the assert and adds a comment.

Pull Request: https://projects.blender.org/blender/blender/pulls/124253
This commit is contained in:
Harley Acheson 2024-07-05 19:36:49 +02:00 committed by Harley Acheson
parent b9edd2e02e
commit 938f50e1f7

@ -1099,7 +1099,9 @@ void ED_fileselect_init_layout(SpaceFile *sfile, ARegion *region)
file_attribute_columns_init(params, layout);
layout->rows = std::max(rowcount, numfiles);
BLI_assert(layout->rows != 0);
/* layout->rows can be zero if a very small area is changed to a File Browser. #124168. */
layout->height = sfile->layout->rows * (layout->tile_h + 2 * layout->tile_border_y) +
layout->tile_border_y * 2 + layout->offset_top;
layout->flag = FILE_LAYOUT_VER;