@@ -701,15 +701,19 @@ public extension GlassBackgroundView {
701701 let context = ctx. cgContext
702702
703703 context. setFillColor ( fillColor. cgColor)
704- context. fill ( CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx : inset , dy : inset ) . insetBy ( dx : 0.1 , dy : 0.1 ) )
704+ context. fill ( CGRect ( origin: CGPoint ( ) , size: size) )
705705
706706 if let image = UIImage ( bundleImageName: " Item List/GlassEdge40x40 " ) {
707- if s <= 0.3 && !isDark {
708- image. draw ( in: CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: inset, dy: inset) , blendMode: . normal, alpha: 0.7 )
707+ let imageInset = ( image. size. width - 40.0 ) * 0.5
708+
709+ if s == 0.0 && abs ( a - 0.7 ) < 0.1 && !isDark {
710+ image. draw ( in: CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: inset - imageInset, dy: inset - imageInset) , blendMode: . normal, alpha: 1.0 )
711+ } else if s <= 0.3 && !isDark {
712+ image. draw ( in: CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: inset - imageInset, dy: inset - imageInset) , blendMode: . normal, alpha: 0.7 )
709713 } else if b >= 0.2 {
710- image. draw ( in: CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: inset, dy: inset) , blendMode: . plusLighter, alpha: 0.7 )
714+ image. draw ( in: CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: inset - imageInset , dy: inset - imageInset ) , blendMode: . plusLighter, alpha: 0.7 )
711715 } else {
712- image. draw ( in: CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: inset, dy: inset) , blendMode: . normal, alpha: 0.5 )
716+ image. draw ( in: CGRect ( origin: CGPoint ( ) , size: size) . insetBy ( dx: inset - imageInset , dy: inset - imageInset ) , blendMode: . normal, alpha: 0.5 )
713717 }
714718 }
715719 }
0 commit comments