From ffe73d4e18df232d5afca5984682975362a8845c Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 28 Sep 2020 12:04:32 -0400 Subject: [PATCH] Make screenshots respect entity brightness --- macrovision.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/macrovision.js b/macrovision.js index ad5e7b19..cfa6b059 100644 --- a/macrovision.js +++ b/macrovision.js @@ -3744,8 +3744,13 @@ function renderToCanvas() { let xSize = img.getBoundingClientRect().width; let ySize = img.getBoundingClientRect().height; + const oldFilter = ctx.filter + const brightness = getComputedStyle(element).getPropertyValue("--brightness") + ctx.filter = `brightness(${brightness})`; ctx.drawImage(img, x, y, xSize, ySize); + + ctx.filter = oldFilter }); }