From 4a0b48ac9e1cef198fda68264a41df52e2ffffd7 Mon Sep 17 00:00:00 2001 From: William Daniau Date: Tue, 22 Oct 2019 10:20:50 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20fonction=20pour=20r=C3=A9cup?= =?UTF-8?q?=C3=A9rer=20un=20facteur=20de=20taille=20de=20police=20dans=20l?= =?UTF-8?q?e=20style.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/html/Wize_S5/ui/default/slides.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/templates/html/Wize_S5/ui/default/slides.js b/templates/html/Wize_S5/ui/default/slides.js index 5183efd..6727632 100644 --- a/templates/html/Wize_S5/ui/default/slides.js +++ b/templates/html/Wize_S5/ui/default/slides.js @@ -398,8 +398,10 @@ function createControls() { function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers if (!s5mode) return false; - var vScale = 22; // both yield 32 (after rounding) at 1024x768 - var hScale = 32; // perhaps should auto-calculate based on theme's declared value? + //var vScale = 22; // both yield 32 (after rounding) at 1024x768 + //var hScale = 32; // perhaps should auto-calculate based on theme's declared value? + var vScale = Math.round(22 / getScaleFromTheme()); + var hScale = Math.round(vScale * 32 / 22); if (window.innerHeight) { var vSize = window.innerHeight; var hSize = window.innerWidth; @@ -422,6 +424,12 @@ function fontScale() { // causes layout problems in FireFox that get fixed if b } } +function getScaleFromTheme() { + var sc = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--main-pres-font-scale')); + sc = isNaN(sc) ? 1.0 : sc; + return sc; +} + function fontSize(value) { if (!(s5ss = document.getElementById('s5ss'))) { if (!isIE) { -- 2.16.4