Patch by DieBuche, who explains the CSS:
If the image height is lower than the line-height, the margin-top
is applied to the top of the line. a very short image will not
follow for 3-4px laters, thus leading to a bigger distance from
the top than it should be. vertical-align:text-top moves the
picture up, so this problem doesn't happen
I've not tested this, but DieBuche and Derk-Jan Hartman tested and
provided screenshots in the bug.
- * Add an image at the beginning of the gallery.
- *
- * @param $title Title object of the image that is added to the gallery
- * @param $html String: Additional HTML text to be shown. The name and size of the image are always shown.
- */
+ * Add an image at the beginning of the gallery.
+ *
+ * @param $title Title object of the image that is added to the gallery
+ * @param $html String: Additional HTML text to be shown. The name and size of the image are always shown.
+ */
function insert( $title, $html='' ) {
if ( $title instanceof File ) {
// Old calling convention
function insert( $title, $html='' ) {
if ( $title instanceof File ) {
// Old calling convention
$imageParameters['alt'] = $nt->getText();
}
$imageParameters['alt'] = $nt->getText();
}
- # Set both fixed width and height. Otherwise we might have problems
- # with the vertical centering of images where height<line-size
+ # Set both fixed width and min-height.
- '<div class="thumb" style="width: ' .($this->mWidths+30).'px; height: ' .($this->mHeights+30).'px;">'
+ '<div class="thumb" style="width: ' .($this->mWidths+30).'px; min-height: ' .($this->mHeights+30).'px;">'
# Auto-margin centering for block-level elements. Needed now that we have video
# handlers since they may emit block-level elements as opposed to simple <img> tags.
# ref http://css-discuss.incutio.com/?page=CenteringBlockElement
# Auto-margin centering for block-level elements. Needed now that we have video
# handlers since they may emit block-level elements as opposed to simple <img> tags.
# ref http://css-discuss.incutio.com/?page=CenteringBlockElement
- . '<div style="margin:'.$vpad.'px auto;">'
+ . '<div style="margin:'.$vpad.'px auto 0;">'
. $thumb->toHtml( $imageParameters ) . '</div></div>';
// Call parser transform hook
. $thumb->toHtml( $imageParameters ) . '</div></div>';
// Call parser transform hook
+li.gallerybox div.thumb a.image img {
+ vertical-align: text-top;
+}
+
div.gallerytext {
overflow: hidden;
font-size: 94%;
div.gallerytext {
overflow: hidden;
font-size: 94%;