]> _ Git - fluidbook_tools.git/commitdiff
wait #6089 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 27 Jun 2023 15:34:02 +0000 (17:34 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 27 Jun 2023 15:34:02 +0000 (17:34 +0200)
src/Links/LayerLink.php
src/Links/ZoomLink.php

index 7f203c58968f6740aa3a3c5e36c67c35fe00262e..8084a642a4271519b896a5daeed034e0a153c1ae 100644 (file)
@@ -22,12 +22,18 @@ class LayerLink extends ImageLink {
         }
     }
 
+    public function getAdditionnalContent() {
+        $res = parent::getAdditionnalContent();
+        $res .= ' data-layer="' . $this->to . '"';
+        return $res;
+    }
+
     public function getImageUrl() {
         return 'data/links/layer_' . $this->uid . '.' . $this->_getExtension();
     }
 
     protected function _getExtension() {
-        if ($this->_getLayer() === 'text' || $this->_getLayer() === 'onlytext') {
+        if ($this->_getLayer() === 'text' || $this->_getLayer() === 'onlytext' || $this->_getLayer() === 'bothsvg') {
             return 'svg';
         } else {
             return 'jpg';
index d97ca9f992693b27a61c06d12b3ff4fd90254edd..1c0216539c3eef278beaf8875e0d5dcffc5ec265 100644 (file)
@@ -113,7 +113,7 @@ class ZoomLink extends NormalLink {
             $extractOptions['quality'] = $attributes['quality'];
         }
 
-        if (isset($attributes['layer']) && !in_array($attributes['layer'], ['image', 'text', 'onlytext'])) {
+        if (isset($attributes['layer']) && !in_array($attributes['layer'], ['image', 'text', 'onlytext', 'bothsvg'])) {
             unset($attributes['layer']);
         }
 
@@ -148,6 +148,8 @@ class ZoomLink extends NormalLink {
                 $extractOptions['texts'] = true;
                 $extractOptions['background'] = false;
                 $ext = $extractOptions['format'] = 'svg';
+            } else if ($attributes['layer'] === 'bothsvg') {
+                $ext = $extractOptions['format'] = 'svg';
             }
         }