From: Vincent Vanwaelscappel Date: Tue, 14 Feb 2023 15:55:59 +0000 (+0100) Subject: wip #5731 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=86b02518e54ad0241c2a7b8dd7f741204c381d46;p=fluidbook_tools.git wip #5731 @1 --- diff --git a/src/Links/Link.php b/src/Links/Link.php index ce43fad..f76c93a 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -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 { } - }