From 33e3bec3373ebe2ce43c0d1bd7d6770be3e17df8 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 5 Jan 2025 00:37:20 +0100 Subject: [PATCH] Fix stretch mode while not cropped --- src/ext/lib/video-transform/Resizer.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ext/lib/video-transform/Resizer.ts b/src/ext/lib/video-transform/Resizer.ts index 7eee030..13036ed 100644 --- a/src/ext/lib/video-transform/Resizer.ts +++ b/src/ext/lib/video-transform/Resizer.ts @@ -280,8 +280,13 @@ class Resizer { return; } - if ([AspectRatioType.Reset, AspectRatioType.Initial].includes(ar.type)) { - // console.log('run level is UI only because aspect ratio type is', ar.type) + // If no aspect ratio is applied AND if no stretch mode is active, + // we disable our CSS in order to prevent breaking websites by default, + // without any human interaction + if ( + [AspectRatioType.Reset, AspectRatioType.Initial].includes(ar.type) && + [StretchType.NoStretch, StretchType.Default].includes(this.stretcher.mode) + ) { this.eventBus.send('set-run-level', RunLevel.UIOnly); } else { this.eventBus.send('set-run-level', RunLevel.CustomCSSActive);