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: Blank snapshot is generated if it exceeds the internal size limitation #66

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

ra1028
Copy link
Member

@ra1028 ra1028 commented Feb 16, 2024

Checklist

  • All tests are passed.
  • Added tests or Playbook scenario.
  • Documented the code using Xcode markup.
  • Searched existing pull requests for ensure not duplicated.

Description

"Interestingly", UIView.drawHierarchy seems to have an internal hard-coded limit size of 8192x8192, and specifying a size beyond that resulting in an empty image is drawn.
It's reported in Apple's developer forums but there's no way properly address that issue.
So this PR adds a workaround that scales down the drawn image into a size that fits within the limitation once and then scales up to the expected size.
This may reduce the quality of the generated snapshots, but was not so critical when tested in the sample app.

@ra1028 ra1028 merged commit 798f686 into master Feb 16, 2024
3 checks passed
@ra1028 ra1028 deleted the fix/blank-snapshot-if-over-8192 branch February 16, 2024 07:39
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.

1 participant