From 2dd8628f2b35e0eb445cf96fb89ac3f60a8e03a9 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 11 Jul 2021 17:59:31 +0300 Subject: [PATCH] fix font size change buttons --- index.html | 4 ++-- modules/ui/style.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 843fdac9..a6bb70b9 100644 --- a/index.html +++ b/index.html @@ -676,8 +676,8 @@ Font size - - + + diff --git a/modules/ui/style.js b/modules/ui/style.js index 73a4c459..b1c718fd 100644 --- a/modules/ui/style.js +++ b/modules/ui/style.js @@ -568,13 +568,13 @@ styleFontSize.addEventListener("change", function () { }); styleFontPlus.addEventListener("click", function () { - const size = Math.max(rn(getEl().attr("data-size") * 1.1, 2), 1); - changeFontSize(size); + const size = +getEl().attr("data-size") + 1; + changeFontSize(Math.min(size, 999)); }); styleFontMinus.addEventListener("click", function () { - const size = Math.max(rn(getEl().attr("data-size") * 0.9, 2), 1); - changeFontSize(size); + const size = +getEl().attr("data-size") - 1; + changeFontSize(Math.max(size, 1)); }); function changeFontSize(size) {