class layerLink extends imageLink
{
- protected $maxzoom_default = 4;
+ protected $maxzoom_default = 2;
public $defaultZIndex = 31;
public function ignore()
if (!$this->rightClone) {
zoomLink::generateImage($attributes, $this->compiler, 'layerlink', 'layer');
}
- return 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;';
}
public function getImageUrl()
{
- return '../links/layer_' . $this->uid . '.jpg';
+ return 'data/links/layer_' . $this->uid . '.jpg';
}
public function getZoomAttributes()
{
+ $z = $this->maxzoom_default * $this->compiler->getCssScale();
return [
'id' => $this->uid,
'page' => $this->page,
- 'maxzoom' => $this->maxzoom_default,
+ 'maxzoom' => $z,
'width' => round($this->width),
'height' => round($this->height),
'x' => round($this->left),
{
$res = parent::getCSS();
$this->copyExternalFile($this->to);
- $res .= 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;';
return $res;
}
- public function getBackgroundPosition()
- {
- $animations = self::parseAnimations($this->image_rollover);
- foreach ($animations as $animation) {
- if (($animation['type'] === 'zoomout' || $animation['type'] === 'zoomin') && isset($animation['transformorigin'])) {
- return $animation['transformorigin'];
- }
- }
- return '50% 50%';
- }
-
- public function getBackgroundSize()
- {
- $size = '100%';
- $animations = self::parseAnimations($this->image_rollover);
- foreach ($animations as $animation) {
- if ($animation['type'] === 'zoomout') {
- $size = round($animation['scale'] * 100) . '%';
- }
- }
- return $size . ' ' . $size;
- }
-
public function getAdditionnalContent()
{
$res = parent::getAdditionnalContent();
return $res;
}
+ public function getHTMLContent()
+ {
+ return '<img src="' . $this->getImageUrl() . '" />';
+ }
}
class inlineSlideshowLink extends slideshowLink
{
$maxzoom = $attributes['maxzoom']; // Max zoom level might not always be set in the link editor
- $maxzoom = max(2, min($maxzoom, 4.166666667));
+ $maxzoom = max(1, min($maxzoom, 4.166666667));
if (!$maxzoom) {
$maxzoom = 2;
}
// The Poppler::extractArea function accepts a resolution setting and uses that to determine the
// scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
// factor by setting the resolution to 72 * $maxzoom
- 'resolution' => 150 * $maxzoom
+ 'resolution' => round(150 * $maxzoom)
];
// Round all link co-ordinates because there seems to be a problem with the the Workshop link editor