skyweb07 / Snap.swift

Snapshot testing in a snap 🎨
MIT License
422 stars 19 forks source link

Fix render glitches and support Spritekit, SceneKit and GLKit #46

Closed ralfebert closed 6 years ago

ralfebert commented 6 years ago

Fixes issue #30

This also changes UIView+Render to only render the layer. The current code actually renders the image twice, once via drawHierarchy and once via layer.render - if there is transparency involved, having these two images drawn on top of each other causes render glitches.

layer.render seems to always work while drawHierarchy only works when a UIWindow/host application is present.

Unfortunately, this might change the rendered image - no visible changes, but the values will differ +- 2 or 3. There seems to be some subtle difference in rendering depending on the API you use. So users who have generated test images before might have to regenerate them :(

skyweb07 commented 6 years ago

This is AWESOME mate!!!, sorry for the delay in the review, thank you very much for this, I'll prepare a release with this great feature