From ddf1bc6a08db2ee10ecf323a0414ad2c26bc9453 Mon Sep 17 00:00:00 2001 From: EoinKanro <54404008+EoinKanro@users.noreply.github.com> Date: Sat, 6 Dec 2025 00:53:07 +0100 Subject: [PATCH] Remove tricky calculations and fix sourceSize --- .../ii/modules/ii/background/Background.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/background/Background.qml b/dots/.config/quickshell/ii/modules/ii/background/Background.qml index c5176343b..afa2731d2 100644 --- a/dots/.config/quickshell/ii/modules/ii/background/Background.qml +++ b/dots/.config/quickshell/ii/modules/ii/background/Background.qml @@ -54,8 +54,8 @@ Variants { property int wallpaperHeight: modelData.height // Some reasonable init value, to be updated property real scaledWallpaperWidth: wallpaperWidth * effectiveWallpaperScale property real scaledWallpaperHeight: wallpaperHeight * effectiveWallpaperScale - property real parallaxTotalPixelsX: Math.max(screen.width - scaledWallpaperWidth, scaledWallpaperWidth - screen.width) - property real parallaxTotalPixelsY: Math.max(screen.height - scaledWallpaperHeight, scaledWallpaperHeight - screen.height) + property real parallaxTotalPixelsX: Math.max(0, scaledWallpaperWidth - screen.width) + property real parallaxTotalPixelsY: Math.max(0, scaledWallpaperHeight - screen.height) readonly property bool verticalParallax: (Config.options.background.parallax.autoVertical && wallpaperHeight > wallpaperWidth) || Config.options.background.parallax.vertical // Colors property bool shouldBlur: (GlobalStates.screenLocked && Config.options.lock.blur.enable) @@ -150,7 +150,7 @@ Variants { x: { if (bgRoot.screen.width > bgRoot.scaledWallpaperWidth) { // Center the picture - return bgRoot.parallaxTotalPixelsX / 2; + return (bgRoot.screen.width - bgRoot.scaledWallpaperWidth) / 2; } let usedFraction = middleFraction; @@ -167,7 +167,7 @@ Variants { y: { if (bgRoot.screen.height > bgRoot.scaledWallpaperHeight) { // Center the picture - return bgRoot.parallaxTotalPixelsY / 2; + return (bgRoot.screen.height - bgRoot.scaledWallpaperHeight) / 2; } let usedFraction = middleFraction; @@ -193,8 +193,8 @@ Variants { } } sourceSize { - width: Math.max(bgRoot.wallpaperWidth, bgRoot.wallpaperWidth / bgRoot.parallaxRation) - height: Math.max(bgRoot.wallpaperHeight, bgRoot.wallpaperHeight / bgRoot.parallaxRation) + width: bgRoot.scaledWallpaperWidth + height: bgRoot.scaledWallpaperHeight } width: bgRoot.scaledWallpaperWidth height: bgRoot.scaledWallpaperHeight