@@ -404,34 +404,34 @@ public class GlassBackgroundView: UIView {
404404
405405 let shadowInset : CGFloat = 32.0
406406
407- let params = Params ( cornerRadius : cornerRadius , isDark : isDark , tintColor: tintColor , isInteractive : isInteractive )
408- if self . params != params {
409- self . params = params
407+ if let innerColor = tintColor. innerColor {
408+ let innerBackgroundFrame = CGRect ( origin : CGPoint ( ) , size : size ) . insetBy ( dx : 3.0 , dy : 3.0 )
409+ let innerBackgroundRadius = min ( innerBackgroundFrame . width , innerBackgroundFrame . height ) * 0.5
410410
411- if let innerColor = params. tintColor. innerColor {
412- let innerBackgroundFrame = CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: 3.0 , dy: 3.0 )
413- let innerBackgroundRadius = min ( innerBackgroundFrame. width, innerBackgroundFrame. height) * 0.5
414-
415- let innerBackgroundView : UIView
416- if let current = self . innerBackgroundView {
417- innerBackgroundView = current
418- } else {
419- innerBackgroundView = UIView ( )
420- self . innerBackgroundView = innerBackgroundView
421- self . contentView. insertSubview ( innerBackgroundView, at: 0 )
422-
423- innerBackgroundView. frame = innerBackgroundFrame
424- innerBackgroundView. layer. cornerRadius = innerBackgroundRadius
425- }
411+ let innerBackgroundView : UIView
412+ if let current = self . innerBackgroundView {
413+ innerBackgroundView = current
414+ } else {
415+ innerBackgroundView = UIView ( )
416+ self . innerBackgroundView = innerBackgroundView
417+ self . contentView. insertSubview ( innerBackgroundView, at: 0 )
426418
427- innerBackgroundView. backgroundColor = innerColor
428- transition. setFrame ( view: innerBackgroundView, frame: innerBackgroundFrame)
429- transition. setCornerRadius ( layer: innerBackgroundView. layer, cornerRadius: innerBackgroundRadius)
430- } else if let innerBackgroundView = self . innerBackgroundView {
431- self . innerBackgroundView = nil
432- innerBackgroundView. removeFromSuperview ( )
419+ innerBackgroundView. frame = innerBackgroundFrame
420+ innerBackgroundView. layer. cornerRadius = innerBackgroundRadius
433421 }
434422
423+ innerBackgroundView. backgroundColor = innerColor
424+ transition. setFrame ( view: innerBackgroundView, frame: innerBackgroundFrame)
425+ transition. setCornerRadius ( layer: innerBackgroundView. layer, cornerRadius: innerBackgroundRadius)
426+ } else if let innerBackgroundView = self . innerBackgroundView {
427+ self . innerBackgroundView = nil
428+ innerBackgroundView. removeFromSuperview ( )
429+ }
430+
431+ let params = Params ( cornerRadius: cornerRadius, isDark: isDark, tintColor: tintColor, isInteractive: isInteractive)
432+ if self . params != params {
433+ self . params = params
434+
435435 if let shadowView = self . shadowView {
436436 let shadowInnerInset : CGFloat = 0.5
437437 shadowView. image = generateImage ( CGSize ( width: shadowInset * 2.0 + cornerRadius * 2.0 , height: shadowInset * 2.0 + cornerRadius * 2.0 ) , rotatedContext: { size, context in
0 commit comments