Skip to content

Commit

Permalink
Simplify update method of the solar engine
Browse files Browse the repository at this point in the history
Since the dynamic wallpaper handler is now smarter about blend factors
such as 1 or 0, the update method of the solar engine can be a bit simpler.
  • Loading branch information
zzag committed Apr 11, 2022
1 parent 9123d06 commit b503497
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/declarative/dynamicwallpaperengine_solar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,11 @@ void SolarDynamicWallpaperEngine::update()
currentImage = std::prev(nextImage);

if (currentImage->crossFadeMode() == KSolarDynamicWallpaperMetaData::CrossFade) {
m_topLayer = DynamicWallpaperImageHandle(m_source.toLocalFile(), nextImage->index()).toUrl();
m_blendFactor = computeBlendFactor(currentImage.key(), nextImage.key(), progress);
} else {
m_topLayer = QUrl();
m_blendFactor = 0;
}

m_topLayer = DynamicWallpaperImageHandle(m_source.toLocalFile(), nextImage->index()).toUrl();
m_bottomLayer = DynamicWallpaperImageHandle(m_source.toLocalFile(), currentImage->index()).toUrl();
}

0 comments on commit b503497

Please sign in to comment.