]> _ Git - fluidbook_tools.git/commitdiff
wip #5731 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Feb 2023 15:55:59 +0000 (16:55 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Feb 2023 15:55:59 +0000 (16:55 +0100)
src/Links/Link.php

index ce43fad7ee4f2f19465450671679bd3570a51970..f76c93a6dfce89ee2ae056d987903cb4a2633724 100644 (file)
@@ -17,7 +17,7 @@ use stdClass;
 
 class Link {
 
-    protected static string|false|null $_linksKey=null;
+    protected static string|false|null $_linksKey = null;
     public $left;
     public $top;
     public $width;
@@ -494,7 +494,7 @@ class Link {
     }
 
     public function getCssScale() {
-        if (is_int($this->page)) {
+        if (is_numeric($this->page) || is_int($this->page)) {
             return $this->compiler->getLinkScale();
         } else {
             return 1;
@@ -520,7 +520,6 @@ class Link {
             $this->left += $this->compiler->getWidth();
         }
 
-
         $css = '#l_' . $this->id . '{';
         $css .= 'left:' . round($this->left * $this->getCssScale()) . 'px;top:' . round($this->top * $this->getCssScale()) . 'px;';
         $css .= 'width:' . round($this->width * $this->getCssScale()) . 'px;height:' . round($this->height * $this->getCssScale()) . 'px;';
@@ -660,8 +659,7 @@ class Link {
     }
 
 
-    public static function encryptLinks($links)
-    {
+    public static function encryptLinks($links) {
         $res = [];
         foreach ($links as $key => $link) {
             $res[$key] = self::encryptLinkAttrs($link);
@@ -672,8 +670,7 @@ class Link {
     /**
      * @throws SodiumException
      */
-    public static function encryptLinkAttrs($link)
-    {
+    public static function encryptLinkAttrs($link) {
         $crypted = [13, 14, 35];
 
         if (!isset($link['type']) || !in_array($link['type'], $crypted)) {
@@ -695,5 +692,4 @@ class Link {
     }
 
 
-
 }