Commit 4a0b48ac9e1cef198fda68264a41df52e2ffffd7

Authored by William Daniau
1 parent 67dc08c1f9
Exists in master

Ajout d'une fonction pour récupérer un facteur de taille de police dans

le style.

Showing 1 changed file with 10 additions and 2 deletions Side-by-side Diff

templates/html/Wize_S5/ui/default/slides.js
... ... @@ -398,8 +398,10 @@
398 398  
399 399 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
400 400 if (!s5mode) return false;
401   - var vScale = 22; // both yield 32 (after rounding) at 1024x768
402   - var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
  401 + //var vScale = 22; // both yield 32 (after rounding) at 1024x768
  402 + //var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
  403 + var vScale = Math.round(22 / getScaleFromTheme());
  404 + var hScale = Math.round(vScale * 32 / 22);
403 405 if (window.innerHeight) {
404 406 var vSize = window.innerHeight;
405 407 var hSize = window.innerWidth;
... ... @@ -420,6 +422,12 @@
420 422 obj.style.display = 'none';
421 423 obj.style.display = 'block';
422 424 }
  425 +}
  426 +
  427 +function getScaleFromTheme() {
  428 + var sc = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--main-pres-font-scale'));
  429 + sc = isNaN(sc) ? 1.0 : sc;
  430 + return sc;
423 431 }
424 432  
425 433 function fontSize(value) {