In My example, I draw a rect use GraphicsContext.
Canvas { context, size in
context.fill(
Path(CGRect(
x: 0,
y: 0,
width: 300,
height: 200
)),
with: .color(.green))
}
.frame(width: 300, height: 200)
Now, I want clear the rect, but not found the clear api in GraphicsContext, how clear the rect?
I try to fill another Color.clear rect overlap the green rect, but not clear rect.
context.fill(
Path(CGRect(
x: 0,
y: 0,
width: 300,
height: 200
)),
with: .color(.clear))