25 parent::__construct( $mode, $context );
35 private const SCALE_FACTOR = 1.5;
37 protected function getVPad( $boxHeight, $thumbHeight ) {
38 return ( $this->
getThumbPadding() + $boxHeight - $thumbHeight / self::SCALE_FACTOR ) / 2;
59 $width = $this->mHeights * 10 + 100;
64 'width' => (int)floor( $width * self::SCALE_FACTOR ),
65 'height' => (int)floor( $this->mHeights * self::SCALE_FACTOR ),
71 if ( $thumbWidth < 60 * self::SCALE_FACTOR ) {
72 $thumbWidth = 60 * self::SCALE_FACTOR;
84 $thumbWidth = $thumb ? $thumb->getWidth() : $this->mWidths * self::SCALE_FACTOR;
91 $imageParameters[
'override-width'] = ceil( $thumb->getWidth() / self::SCALE_FACTOR );
92 $imageParameters[
'override-height'] = ceil( $thumb->getHeight() / self::SCALE_FACTOR );
101 return [
'mediawiki.page.gallery' ];
getThumbPadding()
How much padding the thumb has between the image and the inner div that contains the border.
getVPad( $boxHeight, $thumbHeight)
Get vertical padding for a thumbnail.
__construct( $mode='traditional', IContextSource $context=null)
Create a new image gallery object.
getModules()
Add javascript which auto-justifies the rows by manipulating the image sizes.
getThumbDivWidth( $thumbWidth)
Get the width of the inner div that contains the thumbnail in question.
setPerRow( $num)
Do not support per-row on packed.
adjustImageParameters( $thumb, &$imageParameters)
Adjust the image parameters for a thumbnail.
Interface for objects which can provide a MediaWiki context on request.