]> _ Git - fluidbook_tools.git/commitdiff
wait #7704 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Aug 2025 15:29:06 +0000 (17:29 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Aug 2025 15:29:06 +0000 (17:29 +0200)
src/Links/LayerLink.php
src/Links/ZoomLink.php

index be64ef8fda3d4e8454ea90233fc2e95bf37d7f61..cbc284fd46e48298ecb6ce5835b0e2075d7f2a5e 100644 (file)
@@ -16,10 +16,10 @@ class LayerLink extends ImageLink
 
     public function __construct($id, $init, &$compiler)
     {
-        if ($init['to'] === 'text' || $init['to'] === 'onlytext') {
+        if ($init['to'] === 'text' || $init['to'] === 'onlytext' || $init['to'] === 'textmask') {
             $this->defaultZIndex++;
         }
-        if ($init['to'] === 'text' && $compiler->config->transparentPage) {
+        if ($init['to'] === 'textmask') {
             $compiler->addMask('texts', $init['page'], ['x' => $init['left'], 'y' => $init['top'], 'width' => $init['width'], 'height' => $init['height']]);
         }
         parent::__construct($id, $init, $compiler);
@@ -51,11 +51,10 @@ class LayerLink extends ImageLink
 
     protected function _getExtension()
     {
-        if ($this->_getLayer() === 'text' || $this->_getLayer() === 'onlytext' || $this->_getLayer() === 'bothsvg') {
-            return 'svg';
-        } else {
-            return 'jpg';
-        }
+        return match ($this->_getLayer()) {
+            'text', 'onlytext', 'bothsvg', 'textmask' => 'svg',
+            default => 'jpg',
+        };
     }
 
     protected function _getLayer()
index 005a89daad1e36278c7e5edb654b0d88f4fae245..0f1851f51d764153f2ff656b0f0011497133f7a0 100644 (file)
@@ -127,7 +127,7 @@ class ZoomLink extends NormalLink
             $extractOptions['quality'] = $attributes['quality'];
         }
 
-        if (isset($attributes['layer']) && !in_array($attributes['layer'], ['image', 'text', 'onlytext', 'bothsvg'])) {
+        if (isset($attributes['layer']) && !in_array($attributes['layer'], ['image', 'text', 'onlytext', 'bothsvg', 'textmask'])) {
             unset($attributes['layer']);
         }
 
@@ -165,7 +165,7 @@ class ZoomLink extends NormalLink
             if ($attributes['layer'] === 'image') {
                 $extractOptions['texts'] = false;
                 $extractOptions['background'] = true;
-            } else if ($attributes['layer'] === 'text' || $attributes['layer'] === 'onlytext') {
+            } else if ($attributes['layer'] === 'text' || $attributes['layer'] === 'onlytext' || $attributes['layer'] === 'textmask') {
                 $extractOptions['texts'] = true;
                 $extractOptions['background'] = false;
                 $ext = $extractOptions['format'] = 'svg';