From 463e09f06cef8069ef2a5da7742f1b9a46e0c825 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 27 Jun 2023 17:34:02 +0200 Subject: [PATCH] wait #6089 @0.25 --- src/Links/LayerLink.php | 8 +++++++- src/Links/ZoomLink.php | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) 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'; } } -- 2.39.5