mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-02 10:37:50 +00:00
Background: optimize wallpaper source size calculation
This commit is contained in:
@@ -349,11 +349,23 @@ Variants {
|
||||
|
||||
// ------------------------------------------------------
|
||||
function recalculateImageSizes() {
|
||||
// Re-evaluate and apply optimal sourceSize for both images when ready
|
||||
if (currentWallpaper.status === Image.Ready) {
|
||||
currentWallpaper.calculateSourceSize()
|
||||
const optimal = calculateOptimalWallpaperSize(currentWallpaper.implicitWidth, currentWallpaper.implicitHeight)
|
||||
if (optimal !== undefined && optimal !== false) {
|
||||
currentWallpaper.sourceSize = optimal
|
||||
} else {
|
||||
currentWallpaper.sourceSize = undefined
|
||||
}
|
||||
}
|
||||
|
||||
if (nextWallpaper.status === Image.Ready) {
|
||||
nextWallpaper.calculateSourceSize()
|
||||
const optimal2 = calculateOptimalWallpaperSize(nextWallpaper.implicitWidth, nextWallpaper.implicitHeight)
|
||||
if (optimal2 !== undefined && optimal2 !== false) {
|
||||
nextWallpaper.sourceSize = optimal2
|
||||
} else {
|
||||
nextWallpaper.sourceSize = undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user