From 24aa917356e604b32fccdf508b1eb9651629975d Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 30 May 2022 14:45:42 +0000 Subject: [PATCH] wip #5299 @1 --- .../html5/master/class.ws.html5.links.php | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index a99e6fc75..1ba33f13c 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -1744,7 +1744,7 @@ class remarkableCartLink extends cartLink class layerLink extends imageLink { - protected $maxzoom_default = 4; + protected $maxzoom_default = 2; public $defaultZIndex = 31; public function ignore() @@ -1758,20 +1758,20 @@ class layerLink extends imageLink 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), @@ -1858,33 +1858,9 @@ class imageLink extends contentLink { $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(); @@ -1893,6 +1869,10 @@ class imageLink extends contentLink return $res; } + public function getHTMLContent() + { + return ''; + } } class inlineSlideshowLink extends slideshowLink @@ -2819,7 +2799,7 @@ class zoomLink extends normalLink { $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; } @@ -2830,7 +2810,7 @@ class zoomLink extends normalLink // 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 -- 2.39.5