From 46b7d6a25aed2a8f634208defa417844d47959c5 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 27 Jan 2024 22:24:09 +0100 Subject: [PATCH] Round pixel offset --- src/ext/lib/video-transform/Resizer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext/lib/video-transform/Resizer.ts b/src/ext/lib/video-transform/Resizer.ts index 514da3c..9eee6bb 100644 --- a/src/ext/lib/video-transform/Resizer.ts +++ b/src/ext/lib/video-transform/Resizer.ts @@ -711,7 +711,7 @@ class Resizer { // add remaining elements if (stretchFactors) { - styleArray.push(`transform: translate(${translate.x}px, ${translate.y}px) scale(${stretchFactors.xFactor}, ${stretchFactors.yFactor}) !important;`); + styleArray.push(`transform: translate(${Math.floor(translate.x)}px, ${Math.floor(translate.y)}px) scale(${stretchFactors.xFactor}, ${stretchFactors.yFactor}) !important;`); // important — guarantees video will be properly aligned // Note that position:absolute cannot be put here, otherwise old.reddit /w RES breaks — videos embedded