]> _ Git - fluidbook_tools.git/commitdiff
wip #7704 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Aug 2025 13:51:35 +0000 (15:51 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Aug 2025 13:51:35 +0000 (15:51 +0200)
src/Compiler/Compiler.php
src/Compiler/CompilerInterface.php
src/Compiler/DummyCompiler.php
src/Compiler/Links.php
src/Links/LayerLink.php
src/Links/Link.php

index ec8d65338ac661c8c05b83cd7b0c7243f8476a26..6ab10adeec2931fb027a67a82748f6f5db0c5df8 100644 (file)
@@ -413,4 +413,9 @@ class Compiler implements ShouldQueue, ShouldBeUnique, CompilerInterface {
     public function extractPDFArea($file, $page, $rect, $to=null, $options = array(), $cache = null){
         return PDF::extractArea($file, $page, $rect, $to=null, $options = array(), $cache = null);
     }
+
+    public function addMask($layer, $page, $area)
+    {
+        // TODO: Implement addMask() method.
+    }
 }
index c3d4a5a18f69169c2825b693b8746d9edc315d69..3a081f54c6bb1d29cc1baf01451c9a823d07dfaf 100644 (file)
@@ -80,4 +80,6 @@ interface CompilerInterface
     public function getExternalMultimediaContents($to);
 
     public function extractPDFArea($file, $page, $rect, $to=null, $options = array(), $cache = null);
+
+    public function addMask($layer, $page, $area);
 }
index 9d24a63c594f1c110c370b436ca3c1ec32723a0f..4e469acd871bf653c2c4c6584609e8b5acb7fc26 100644 (file)
@@ -169,4 +169,9 @@ class DummyCompiler implements CompilerInterface {
     {
         // TODO: Implement extractPDFArea() method.
     }
+
+    public function addMask($layer, $page, $area)
+    {
+        // TODO: Implement addMask() method.
+    }
 }
index fa00c00695aaeb4d3b107e3376d9178a118185ce..514e9713b67f85efdce4719e6df8ce04fafc0f15 100644 (file)
@@ -2,13 +2,11 @@
 
 namespace Fluidbook\Tools\Compiler;
 
-use Cubist\Util\ArrayUtil;
 use Cubist\Util\Files\Files;
 use Cubist\Util\Zip;
 use Exception;
 use Fluidbook\Tools\Links\ContentLink;
 use Fluidbook\Tools\Links\Link;
-use Nette\Utils\Image;
 
 trait Links
 {
index b9ae28f7bb37d9703665bb1dd4c6033563c2a533..3d3ed9d9d2525379de1ff32505cb6ce65049ee6c 100644 (file)
@@ -19,6 +19,9 @@ class LayerLink extends ImageLink
         if ($init['to'] === 'text' || $init['to'] === 'onlytext') {
             $this->defaultZIndex++;
         }
+        if ($init['to'] === 'text' && $compiler->config->transparentPage) {
+            $this->compiler->addMask('texts', $init['page'], ['x' => $init['left'], 'y' => $init['top'], 'width' => $init['width'], 'height' => $init['height']]);
+        }
         parent::__construct($id, $init, $compiler);
     }
 
@@ -77,5 +80,4 @@ class LayerLink extends ImageLink
     }
 
 
-
 }
index 90c645763daa9728528c6c8206ca8a7f85097c4c..45688fc701cda5ede338cfdcb405bd52f4953e9a 100644 (file)
@@ -75,6 +75,7 @@ class Link
     const SLIDESHOW_INLINE = 46;
     const PAGE_BACKGROUND_COLOR = 48;
     const FLUIDBOOK_TOOLBOX_ELEARNING_CONTENT = 49;
+    const LAYER_MASK = 50;
 
     protected static string|false|null $_linksKey = null;
     public $left;
@@ -365,6 +366,9 @@ class Link
             case static::PAGE_BACKGROUND_COLOR:
                 $compiler->addPageBackground($init['page'], $init['to'] ?? '', $init['extra'] ?? '', $init['alternative'] ?? '');
                 break;
+            case static::LAYER_MASK:
+                $compiler->addMask($init['to'], $init['page'], ['x' => $init['left'], 'y' => $init['top'], 'width' => $init['width'], 'height' => $init['height']]);
+                break;
             default:
                 return null;
         }