summaryrefslogtreecommitdiffstats
path: root/src/ui/previewholder.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2006-04-09 08:15:46 +0000
committerjoncruz <joncruz@users.sourceforge.net>2006-04-09 08:15:46 +0000
commit5b46e2f377145dd25e180177282dd187b8c83e63 (patch)
tree87f26619a107c0454806c6a53644e79655c37578 /src/ui/previewholder.cpp
parentFixed <b></b> mismatches (diff)
downloadinkscape-5b46e2f377145dd25e180177282dd187b8c83e63.tar.gz
inkscape-5b46e2f377145dd25e180177282dd187b8c83e63.zip
Fixed problem when swatches were larger than provided area
(bzr r465)
Diffstat (limited to 'src/ui/previewholder.cpp')
-rw-r--r--src/ui/previewholder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index f48cc1ca0..bcb4d0282 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -208,8 +208,8 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int&
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;