Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: detect swiftui images not too agressively #181

Merged
merged 8 commits into from
Sep 6, 2024

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Sep 5, 2024

💡 Motivation and Context

If you do:

ZStack {
            Color.white
                .edgesIgnoringSafeArea(.all)
            
            ScrollView {
                VStack(spacing: 50) {
                    ForEach((1...40).reversed(), id: \.self) {
                        Text("\($0)")
                            .frame(maxWidth: .infinity)
                            .frame(height: 40)
                    }
                }
            }
        }

the whole screenshot will be masked because Color is of the type _UIGraphicsView, if you have masking enabled.
here we special case this type so its never masked but other things that are inherited from _UIGraphicsView should still be masked.

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@marandaneto marandaneto requested a review from a team September 6, 2024 09:32
@marandaneto marandaneto marked this pull request as ready for review September 6, 2024 09:34
PostHogExample/PostHogExampleApp.swift Outdated Show resolved Hide resolved
@marandaneto marandaneto merged commit 3f20bb4 into main Sep 6, 2024
6 checks passed
@marandaneto marandaneto deleted the fix/detect-images-swiftui branch September 6, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants