From: Vincent Vanwaelscappel Date: Mon, 22 Aug 2022 15:56:04 +0000 (+0200) Subject: wip #5408 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c21e703e0c812623f16e850e29f0ecc7a9bcfd68;p=fluidbook_tools.git wip #5408 @0.25 --- diff --git a/src/Compiler/FluidbookCompiler.php b/src/Compiler/FluidbookCompiler.php index 5ce6a6d..ef14612 100644 --- a/src/Compiler/FluidbookCompiler.php +++ b/src/Compiler/FluidbookCompiler.php @@ -2,6 +2,7 @@ namespace Fluidbook\Tools\Compiler; +use Cubist\Util\Data; use Cubist\Util\Files\VirtualDirectory; trait FluidbookCompiler @@ -14,6 +15,11 @@ trait FluidbookCompiler */ public $wdir = ''; + /** + * @var Data + */ + public $config; + /** * @return VirtualDirectory */ @@ -40,7 +46,7 @@ trait FluidbookCompiler $this->wdir = $wdir; } - public function working_path($path = ''):string + public function working_path($path = ''): string { $res = $this->getWorkingDir(); return $path ? $res . '/' . $path : $res; diff --git a/src/Links/LayerLink.php b/src/Links/LayerLink.php index d9758b6..d11b359 100644 --- a/src/Links/LayerLink.php +++ b/src/Links/LayerLink.php @@ -7,6 +7,11 @@ class LayerLink extends ImageLink protected $maxzoom_default = 4; public $defaultZIndex = 31; + public function ignore() + { + return parent::ignore() || $this->isOutsidePage(); + } + public function getCSS() { $attributes = $this->getZoomAttributes(); diff --git a/src/Links/Link.php b/src/Links/Link.php index 4dcf849..d5a5f99 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -600,6 +600,21 @@ class Link } } + public function isOutsidePage() + { + if ($this->top > $this->compiler->getSetting('height')) { + return true; + } + if ($this->left > $this->compiler->getSetting('width')) { + return true; + } + } + + public function ignore() + { + return false; + } + public function getConfigZIP($d) { return $this->compiler->getConfigZIP($d); diff --git a/src/Links/ZoomLink.php b/src/Links/ZoomLink.php index 1ff13bb..dbd9598 100644 --- a/src/Links/ZoomLink.php +++ b/src/Links/ZoomLink.php @@ -13,6 +13,11 @@ class ZoomLink extends NormalLink protected $maxzoom_default = 2; protected $_groups = null; + public function ignore() + { + return parent::ignore() || $this->isOutsidePage(); + } + public function getGroups() { if (null === $this->_groups) {