mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Adjust inverted pattern presentation
This commit is contained in:
parent
c80bc87fea
commit
9561771c5f
@ -20,6 +20,12 @@ public func dateFillNeedsBlur(theme: PresentationTheme, wallpaper: TelegramWallp
|
||||
return false
|
||||
} else if case .color = wallpaper {
|
||||
return false
|
||||
} else if case let .file(_, _, _, _, isPattern, _, _, _, settings) = wallpaper {
|
||||
if isPattern, let intensity = settings.intensity, intensity < 0 {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
|
@ -112,10 +112,14 @@ public final class WallpaperBackgroundNode: ASDisplayNode {
|
||||
needsCleanBackground = true
|
||||
}
|
||||
|
||||
var isInvertedGradient = false
|
||||
var hasComplexGradient = false
|
||||
switch wallpaper {
|
||||
case let .file(_, _, _, _, _, _, _, _, settings):
|
||||
hasComplexGradient = settings.colors.count >= 3
|
||||
if let intensity = settings.intensity, intensity < 0 {
|
||||
isInvertedGradient = true
|
||||
}
|
||||
case let .gradient(_, colors, _):
|
||||
hasComplexGradient = colors.count >= 3
|
||||
default:
|
||||
@ -125,6 +129,15 @@ public final class WallpaperBackgroundNode: ASDisplayNode {
|
||||
var needsGradientBackground = false
|
||||
var needsWallpaperBackground = false
|
||||
|
||||
if isInvertedGradient {
|
||||
switch self.bubbleType {
|
||||
case .free:
|
||||
needsCleanBackground = false
|
||||
case .incoming, .outgoing:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if needsCleanBackground {
|
||||
if hasComplexGradient {
|
||||
needsGradientBackground = backgroundNode.gradientBackgroundNode != nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user