]> _ Git - fluidbook_tools.git/commitdiff
wait #5997 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Jun 2023 17:52:51 +0000 (19:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Jun 2023 17:52:51 +0000 (19:52 +0200)
src/Links/LayerLink.php
src/Links/ZoomLink.php

index dd6c65f65836eb12d0e9696000ad036e36fe02ba..7646061a7db05afb480e0fb13001d57d71b6f6e0 100644 (file)
@@ -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,
         ];
     }
 }
index 3716e9ed4bd18720201bff6e78e90778f4a6b3db..43291f71a903295b8366cefab7e1ef5f03dfc5d8 100644 (file)
@@ -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];