From bc6b58aa3f1681b0f665c61722b7fd546d0278a3 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 7 May 2024 21:02:22 +0200 Subject: [PATCH] Ensure transform offsets are is rounded --- 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 b7b511d..0ca1bf5 100644 --- a/src/ext/lib/video-transform/Resizer.ts +++ b/src/ext/lib/video-transform/Resizer.ts @@ -855,7 +855,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.round(translate.x)}px, ${Math.round(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