]> _ Git - fluidbook_tools.git/commitdiff
wait #6422 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 15 Nov 2023 08:40:54 +0000 (09:40 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 15 Nov 2023 08:40:54 +0000 (09:40 +0100)
src/Links/LayerLink.php

index 68a5ea65c423276a57ec87df682ce071f345758d..270229f7e08117cd03feff90ed17d6ac9ab9dea7 100644 (file)
@@ -4,15 +4,18 @@ namespace Fluidbook\Tools\Links;
 
 use Illuminate\Support\Facades\Log;
 
-class LayerLink extends ImageLink {
+class LayerLink extends ImageLink
+{
     protected $maxzoom_default = 4;
     public $defaultZIndex = 30;
 
-    public function ignore() {
+    public function ignore()
+    {
         return parent::ignore() || $this->isOutsidePage();
     }
 
-    public function __construct($id, $init, &$compiler) {
+    public function __construct($id, $init, &$compiler)
+    {
         if ($init['to'] === 'text' || $init['to'] === 'onlytext') {
             $this->defaultZIndex++;
         }
@@ -22,24 +25,28 @@ class LayerLink extends ImageLink {
     /**
      * @throws \Exception
      */
-    public function getCSS() {
+    public function getCSS()
+    {
         $attributes = $this->getZoomAttributes();
         if (!$this->rightClone) {
             ZoomLink::generateImage($attributes, $this->compiler, 'layerlink', 'layer');
         }
     }
 
-    public function getAdditionnalContent() {
+    public function getAdditionnalContent()
+    {
         $res = parent::getAdditionnalContent();
         $res .= ' data-layer="' . $this->to . '"';
         return $res;
     }
 
-    public function getImageUrl() {
+    public function getImageUrl()
+    {
         return 'data/links/layer_' . $this->uid . '.' . $this->_getExtension();
     }
 
-    protected function _getExtension() {
+    protected function _getExtension()
+    {
         if ($this->_getLayer() === 'text' || $this->_getLayer() === 'onlytext' || $this->_getLayer() === 'bothsvg') {
             return 'svg';
         } else {
@@ -47,12 +54,15 @@ class LayerLink extends ImageLink {
         }
     }
 
-    protected function _getLayer() {
+    protected function _getLayer()
+    {
         return $this->to ?: 'both';
     }
 
-    public function getZoomAttributes() {
+    public function getZoomAttributes()
+    {
         $layer = $this->_getLayer();
+
         return [
             'id' => $this->uid,
             'page' => $this->page,