Pattern wallpaper improvements and bug fixes

This commit is contained in:
Ilya Laktyushin
2019-01-27 16:41:20 +03:00
parent 42cc137468
commit dfd335741b
28 changed files with 3440 additions and 2976 deletions

View File

@@ -102,9 +102,9 @@ func chatControllerBackgroundImage(wallpaper: TelegramWallpaper, mode: Wallpaper
}
}
case let .file(file):
if file.isPattern, let color = file.settings.color {
if file.isPattern, let color = file.settings.color, let intensity = file.settings.intensity {
var image: UIImage?
let _ = postbox.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedPatternWallpaperRepresentation(color: color), complete: true, fetch: true, attemptSynchronously: true).start(next: { data in
let _ = postbox.mediaBox.cachedResourceRepresentation(file.file.resource, representation: CachedPatternWallpaperRepresentation(color: color, intensity: intensity), complete: true, fetch: true, attemptSynchronously: true).start(next: { data in
if data.complete {
image = UIImage(contentsOfFile: data.path)?.precomposed()
}