From: vincent@cubedesigners.com Date: Fri, 19 Jun 2020 16:03:23 +0000 (+0000) Subject: wip #3712 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=581bbdac993fd6f3415680e60d05cfb485c46970;p=cubeextranet.git wip #3712 @1 --- 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 66b81f54c..593c2d12f 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -1863,8 +1863,11 @@ class zoomLink extends normalLink public function generateImage() { - $maxzoom = ((int)$this->to !== 0) ? $this->to : $this->maxzoom_default; // Max zoom level might not always be set in the link editor - $maxzoom = min($maxzoom, 4.166666667); + $maxzoom = $this->getZoomAttributes()['maxzoom']; // Max zoom level might not always be set in the link editor + $maxzoom = max(2, min($maxzoom, 4.166666667)); + if(!$maxzoom){ + $maxzoom=2; + } // TODO: Consider generating higher-res images (eg. 2x) for HiDPI screens. Maybe some extra optimisations can be done on the larger images... @@ -1941,6 +1944,8 @@ class zoomLink extends normalLink class zoomProductLink extends zoomLink { + protected $maxzoom_default = 2.5; + public function __construct($id, $init, &$compiler) { $init['group'] = $init['to']; @@ -1951,9 +1956,9 @@ class zoomProductLink extends zoomLink { $url = isset($this->compiler->config->product_zoom_references[$this->to]) ? $this->compiler->config->product_zoom_references[$this->to] : ''; - $res = array_merge(parent::getZoomAttributes(), - ['maxzoom' => $this->maxzoom_default, 'ref' => $this->to] - ); + $res = parent::getZoomAttributes(); + $res['maxzoom'] = $this->maxzoom_default; + $res['ref'] = $this->to; if ($url) { $res['shareurl'] = $url[0]; $n = count($url); @@ -1966,6 +1971,7 @@ class zoomProductLink extends zoomLink return $res; } + }