SKView CAMetalLayer framebufferOnly = false flips content by y. Why?

63 Views Asked by At

This code cause SKView flip content by Y:

let sceneView = SKView(frame: CGRect(x:0 , y:0, width: 640, height: 480))
...
(sceneView.layer as? CAMetalLayer)?.framebufferOnly = false

View playground with this bug on GitHub.com

I finded solve, but don't know how good is

sceneView.transform = CGAffineTransform.identity.scaledBy(x: 1.0, y: -1.0)

But still don't understand why this flip happens, and if there exist better solved of this?

1

There are 1 best solutions below

0
On

I finded solve, but don't know how good is

sceneView.transform = CGAffineTransform.identity.scaledBy(x: 1.0, y: -1.0)

But still don't understand why this flip happens, and if there exist better solved of this?