better fix for bug 27338 - doesnt rely on line-height
authorRyan Kaldari <kaldari@users.mediawiki.org>
Mon, 4 Jul 2011 21:30:09 +0000 (21:30 +0000)
committerRyan Kaldari <kaldari@users.mediawiki.org>
Mon, 4 Jul 2011 21:30:09 +0000 (21:30 +0000)
includes/ImageGallery.php
skins/common/shared.css

index 920ef05..5c2ed89 100644 (file)
@@ -281,10 +281,7 @@ class ImageGallery {
                                $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( self::THUMB_PADDING + $this->mHeights ) . 'px;">'
                                        . htmlspecialchars( $img->getLastError() ) . '</div>';
                        } else {
-                               # We get layout problems with the margin, if the image is smaller 
-                               # than the line-height (17), so we add less margin in these cases.
-                               $minThumbHeight =  $thumb->height > 17 ? $thumb->height : 17;
-                               $vpad = ( self::THUMB_PADDING + $this->mHeights - $minThumbHeight ) /2;
+                               $vpad = ( self::THUMB_PADDING + $this->mHeights - $thumb->height ) /2;
 
                                $imageParameters = array(
                                        'desc-link' => true,
index d124860..493bbab 100644 (file)
@@ -561,6 +561,11 @@ li.gallerybox div.thumb {
        margin: 2px;
 }
 
+li.gallerybox div.thumb img {
+       display: block;
+       margin: 0 auto;
+}
+
 div.gallerytext {
        overflow: hidden;
        font-size: 94%;