summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b0efc3d)
raw | patch | inline | side by side (parent: b0efc3d)
author | joncruz <joncruz@users.sourceforge.net> | |
Sun, 9 Apr 2006 08:15:46 +0000 (08:15 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Sun, 9 Apr 2006 08:15:46 +0000 (08:15 +0000) |
src/ui/previewholder.cpp | patch | blob | history |
index f48cc1ca0dceacf9b626d7b12e7bbcab7b7e3593..bcb4d0282c6f8e7510187af44c4a7e011740f5d4 100644 (file)
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
Gtk::Requisition req2;
const_cast<Gtk::Widget*>(thing)->size_request(req2);
- int h2 = req.height / req2.height;
- int w2 = req.width / req2.width;
+ int h2 = ((req2.height > 0) && (req.height > req2.height)) ? (req.height / req2.height) : 1;
+ int w2 = ((req2.width > 0) && (req.width > req2.width)) ? (req.width / req2.width) : 1;
width = (itemCount + (h2 - 1)) / h2;
if ( width < w2 ) {
width = w2;