]> _ Git - fluidbook_tools.git/commitdiff
wip #5408 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 22 Aug 2022 15:56:04 +0000 (17:56 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 22 Aug 2022 15:56:04 +0000 (17:56 +0200)
src/Compiler/FluidbookCompiler.php
src/Links/LayerLink.php
src/Links/Link.php
src/Links/ZoomLink.php

index 5ce6a6d7861354d5ef75adbfe17c8f973550b458..ef1461284fed57c1e6162fec273844c8eb026fc7 100644 (file)
@@ -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;
index d9758b6dbd8f4fbca3685b6f13257585f4093d70..d11b359f1884137fef58db5cb8545179a04a75cc 100644 (file)
@@ -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();
index 4dcf8496e157a8ac2f9ac0187b587208a0b5ffac..d5a5f99a40d39435b28e0e3ed309d9a0b1499e11 100644 (file)
@@ -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);
index 1ff13bb76434f441780c5c58715fdad3f7644c89..dbd95987e552a72f65b52ad7be1029efef4d4b32 100644 (file)
@@ -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) {