From: Vincent Vanwaelscappel Date: Thu, 27 Apr 2023 14:20:44 +0000 (+0200) Subject: wait #5890 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e01e5db64511729f15d44c7065b9f7552f1faafc;p=fluidbook_tools.git wait #5890 @0.25 --- diff --git a/src/Links/LayerLink.php b/src/Links/LayerLink.php index 0e1891b..df2e7cd 100644 --- a/src/Links/LayerLink.php +++ b/src/Links/LayerLink.php @@ -2,34 +2,31 @@ namespace Fluidbook\Tools\Links; -class LayerLink extends ImageLink -{ +use Illuminate\Support\Facades\Log; + +class LayerLink extends ImageLink { protected $maxzoom_default = 4; public $defaultZIndex = 31; - public function ignore() - { + public function ignore() { return parent::ignore() || $this->isOutsidePage(); } /** * @throws \Exception */ - public function getCSS() - { + public function getCSS() { $attributes = $this->getZoomAttributes(); if (!$this->rightClone) { ZoomLink::generateImage($attributes, $this->compiler, 'layerlink', 'layer'); } } - public function getImageUrl() - { + public function getImageUrl() { return 'data/links/layer_' . $this->uid . '.jpg'; } - public function getZoomAttributes() - { + public function getZoomAttributes() { return [ 'id' => $this->uid, 'page' => $this->page, diff --git a/src/Links/ZoomLink.php b/src/Links/ZoomLink.php index c1b6fc0..53c70cb 100644 --- a/src/Links/ZoomLink.php +++ b/src/Links/ZoomLink.php @@ -117,7 +117,7 @@ class ZoomLink extends NormalLink { $y = $attributes['y']; $w = $attributes['width']; $h = $attributes['height']; - $bookwidth = round($compiler->getSetting('width')); + $bookwidth = round($compiler->getWidthForLinks()); if (!isset($attributes['pdf']) || !$attributes['pdf']) { $pdfpath = $compiler->getPagePDFSource($attributes['page']); @@ -134,6 +134,7 @@ class ZoomLink extends NormalLink { array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h), null, $extractOptions, $cache); + if (($x + $w) > $bookwidth && !$compiler->isOnePage()) { if (!isset($attributes['pdf']) || !$attributes['pdf']) { $pdfpath = $compiler->getPagePDFSource($attributes['page'] + 1);