From: Vincent Vanwaelscappel Date: Tue, 27 Jun 2023 15:34:02 +0000 (+0200) Subject: wait #6089 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=463e09f06cef8069ef2a5da7742f1b9a46e0c825;p=fluidbook_tools.git wait #6089 @0.25 --- diff --git a/src/Links/LayerLink.php b/src/Links/LayerLink.php index 7f203c5..8084a64 100644 --- a/src/Links/LayerLink.php +++ b/src/Links/LayerLink.php @@ -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'; diff --git a/src/Links/ZoomLink.php b/src/Links/ZoomLink.php index d97ca9f..1c02165 100644 --- a/src/Links/ZoomLink.php +++ b/src/Links/ZoomLink.php @@ -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'; } }