From b1e9dd1fdf95a9428a7a4fde2b518a0a59c0f04d Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 17 Jan 2018 17:25:26 +0000 Subject: [PATCH] #1584 --- inc/ws/Metier/class.ws.document.php | 2 ++ .../html5/master/class.ws.html5.compiler.php | 30 +++++++------------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 8dde71763..2560509a9 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -598,6 +598,8 @@ class wsDocument extends cubeMetier { $pdftocairo->setPath(CONVERTER_PATH); $pdftocairo->setArg('f', $page); $pdftocairo->setArg('l', $page); + $pdftocairo->setArg('r', 300); + $pdftocairo->setArg(null, '-expand'); $pdftocairo->setArg(null, '-svg'); $pdftocairo->setArg(null, $this->cropped); $pdftocairo->setArg(null, $svgFile); 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 0d15cdb48..30aa9412b 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -230,7 +230,7 @@ class wsHTML5Compiler { $this->cssOneWidth = $this->width * $this->cssOneScale; $this->cssOneHeight = $this->height * $this->cssOneScale; - $this->cssSVGScale = 0.75 / 2; + $this->cssSVGScale = 1; $this->scale = 1; if ($this->book->parametres->zoomMode == 1) { @@ -1333,25 +1333,17 @@ class wsHTML5Compiler { $lessVariables['page-transition-duration'] = $this->book->parametres->mobileTransitionDuration . 's'; - $res[] = '.background{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';}'; - foreach ($this->getResolutions() as $r) { - $ratio = round(72 / $r, 3) * $cssScale; + $res[] = '.background{width:100%;height:100%}'; - $wr = $cssWidth / $ratio; - $hr = $cssHeight / $ratio; - - $br = '.background.r' . $r . '{'; - if ($ratio != 1) { - $br .= wsHTML5::writeCSSUA('transform', 'scale(' . $ratio . ')') . ';'; - } - $br .= 'width:' . $wr . 'px;height:' . $hr . 'px;}'; - $res[] = $br; - } - $texts = '.texts{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';'; - $texts .= wsHTML5::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';'; - $texts .= 'width:' . ($wm / $this->cssSVGScale) . 'px; max-width:' . ($wm / $this->cssSVGScale) . 'px;'; - $texts .= 'height:' . ($hm / $this->cssSVGScale) . 'px; max-height:' . ($hm / $this->cssSVGScale) . 'px;'; - $texts .= '}'; + if ($this->cssSVGScale != 1) { + $texts = '.texts{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';'; + $texts .= wsHTML5::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';'; + $texts .= 'width:' . ($wm / $this->cssSVGScale) . 'px; max-width:' . ($wm / $this->cssSVGScale) . 'px;'; + $texts .= 'height:' . ($hm / $this->cssSVGScale) . 'px; max-height:' . ($hm / $this->cssSVGScale) . 'px;'; + $texts .= '}'; + } else { + $texts = '.texts{width:' . floor(($wm / $this->cssSVGScale) + 4) . 'px;height:' . floor(($hm / $this->cssSVGScale) + 4) . 'px;}'; + } $res[] = $texts; // Theme -- 2.39.5