summaryrefslogtreecommitdiffstats
path: root/src/ui/previewholder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/previewholder.cpp')
-rw-r--r--src/ui/previewholder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index 789156aa5..a7d2c97ff 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -313,12 +313,13 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* item, int itemCount, int& n
natural_width_item = 1;
}
ncols = width_scroller / natural_width_item - 1;
- nrows = itemCount / ncols;
// On first run, scroller width is not set correct... so we need to fudge it:
if (ncols < 2) {
ncols = itemCount/2;
nrows = 2;
+ } else {
+ nrows = itemCount / ncols;
}
}
} else {