Post

Replies

Boosts

Views

Activity

Reply to SwiftUI in iOS14: drawingGroup() and Mask have broken behaviour
I'm also seeing issues with mask in the latest beta that didn't happen on beta 1. My code: import SwiftUI struct ContentView: View { 		var dollarFill: some View { 				LinearGradient( 						gradient: Gradient(colors: [ 								Color.green, 								Color.blue 						]), 						startPoint: .top, 						endPoint: .bottom 				) 				.cornerRadius(10) 		} 		var dollarFillPercent: CGFloat = 0.7 		var body: some View { 				GeometryReader { gr in 						ZStack { 								self.dollarFill 										.mask(ZStack(alignment: .leading) { 												RoundedRectangle(cornerRadius: 10) 														.frame(width: gr.size.width * self.dollarFillPercent) 												RoundedRectangle(cornerRadius: 10) 														.strokeBorder(style: StrokeStyle(lineWidth: 1.0, dash: [5])) 										}) 						} 				}.aspectRatio(CGFloat(2.25), contentMode: .fit) 		} } The forum won't let me post screenshots, but basically what I see on beta 1 is a 70% "filled in" rectangle. In beta 2, this rectangle is 100% filled in no matter what dollarFillPercent is set to. May not be the same issue as OP, but sounded potentially related?
Jul ’20