From 74fc7a0113de1cb6423af3cb5ccac7e5b54eb639 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Thu, 1 Apr 2021 17:09:30 -0400 Subject: [PATCH] Fix a Firefox rendering bug Firefox would revert to the default size for an element if its height went past 17895698px. This fix just sets height to zero when exceeding that value. --- macrovision.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/macrovision.js b/macrovision.js index 990cfc10..ef216203 100644 --- a/macrovision.js +++ b/macrovision.js @@ -475,8 +475,16 @@ function updateEntityElement(entity, element) { const extra = entity.views[view].image.extra; const bottom = entity.views[view].image.bottom; const bonus = (extra ? extra : 1) * (1 / (1 - (bottom ? bottom : 0))); - element.style.setProperty("--height", pixels * bonus + "px"); - element.style.setProperty("--extra", pixels * bonus - pixels + "px"); + let height = pixels * bonus; + + // working around a Firefox bug here + + if (height > 17895698) { + height = 0; + } + + element.style.setProperty("--height", height + "px"); + element.style.setProperty("--extra", height - pixels + "px"); element.style.setProperty("--brightness", entity.brightness);