From 09ef6268e34863148cc5bc38d30e819df68f79e4 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 6 Jun 2023 19:52:51 +0200 Subject: [PATCH] wait #5997 @0.5 --- src/Links/LayerLink.php | 2 ++ src/Links/ZoomLink.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/Links/LayerLink.php b/src/Links/LayerLink.php index dd6c65f..7646061 100644 --- a/src/Links/LayerLink.php +++ b/src/Links/LayerLink.php @@ -27,6 +27,7 @@ class LayerLink extends ImageLink { } public function getZoomAttributes() { + $layer = $this->to ?: 'both'; return [ 'id' => $this->uid, 'page' => $this->page, @@ -35,6 +36,7 @@ class LayerLink extends ImageLink { 'height' => round($this->height), 'x' => round($this->left), 'y' => round($this->top), + 'layer' => $layer, ]; } } diff --git a/src/Links/ZoomLink.php b/src/Links/ZoomLink.php index 3716e9e..43291f7 100644 --- a/src/Links/ZoomLink.php +++ b/src/Links/ZoomLink.php @@ -112,6 +112,10 @@ class ZoomLink extends NormalLink { $extractOptions['quality'] = $attributes['quality']; } + if (isset($attributes['layer']) && !in_array($attributes['layer'], ['image', 'text'])) { + unset($attributes['layer']); + } + $x = $attributes['x']; $y = $attributes['y']; $w = $attributes['width']; @@ -126,6 +130,10 @@ class ZoomLink extends NormalLink { $extractPage = $attributes['page']; } + if (isset($attributes['layer']) && $attributes['layer'] === 'image') { + $extractOptions['texts'] = false; + } + $cache = $compiler->getCacheDir("zoomarea/" . $cachedir); $leftArea = ['x' => $x, 'y' => $y, 'width' => $w, 'height' => $h]; -- 2.39.5