From aac3375609a9812b2a2af9cf3118c08b1c773ff0 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 12 Jul 2021 16:44:23 +0000 Subject: [PATCH] wait #4591 @1.5 --- .../Util/html5/master/class.ws.html5.compiler.php | 14 ++++++++------ inc/ws/Util/html5/master/class.ws.html5.links.php | 8 ++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 3f56205e9..e70193ebe 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1722,17 +1722,13 @@ height="0" width="0" style="display:none;visibility:hidden"> $linkData = wsLinks::decryptLink($linkData); $animations = contentLink::parseAnimations($linkData['image_rollover']); foreach ($animations as $animation) { - if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] != 'transparent') { + if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] !== 'transparent') { $dupData = $linkData; $dupData['type'] = 14; $dupData['to'] = $animation['backgroundcolor']; $dupData['uid'] = 'b_' . $linkData['uid']; - if (!isset($animation['zindex'])) { - $animation['zindex'] = 0; - } - $z = intval($animation['zindex']) - 1; - $dupData['image_rollover'] = 'zindex=' . $z; + $dupData['image_rollover'] = 'addzindex=-1'; array_push($links, $dupData); array_push($links, $linkData); unset($links[$k]); @@ -1918,6 +1914,12 @@ height="0" width="0" style="display:none;visibility:hidden"> } + public function getBookSurface() + { + $s = $this->width * $this->height; + return $s; + } + protected function _sortLinksByDepth($a, $b) { $c = $a->getDepth() - $b->getDepth(); diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 69108a61c..2b547b571 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -39,6 +39,7 @@ class wsHTML5Link public $hidden = false; public $defaultZIndex = 70; public $zindex = -1; + public $addzindex = 0; public $rightClone = false; public $iframeType = "none"; public $border = 0; @@ -550,13 +551,13 @@ class wsHTML5Link public function getCSSZIndex() { - $zindex = $this->getAddZIndex() + (($this->getDepth() + 1) * 1000) - min(999, round(999 * (($this->width * $this->height) / ($this->compiler->width * 2 * $this->compiler->height)))); + $zindex = $this->getAddZIndex() + (($this->getDepth() + 1) * 10000) - min(9999, max(1, round(9999 * (($this->width * $this->height) / $this->compiler->getBookSurface())))); return 'z-index:' . $zindex . ';'; } public function getAddZIndex() { - return 0; + return $this->addzindex; } public function moveOnEvenPage() @@ -967,6 +968,9 @@ class contentLink extends wsHTML5Link if (isset($animation['zindex'])) { $this->zindex = $animation['zindex']; } + if (isset($animation['addzindex'])) { + $this->addzindex = $animation['addzindex']; + } } $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" '; if ($this->_isHiddenFirst($animations)) { -- 2.39.5