Skip to content

Transforming wgpu Canvas in a View with background color results in Canvas falling behind the View #268

@VoidFrog

Description

@VoidFrog

Transforming the wgpu Canvas using CSS transform with perspective and rotateX or rotateY results in a very strange behaviour. It seems as if the View below it in terms of layers starts having priority in blending, but only for the part that should seem farther away.

Here's the link for the minimal reproduction repo that I made

If you want to take a quick look you can see how it behaves in a bit more complex reproduction, with the View transformed to showcase the problem in another way (behaves the same, but looks a bit less clear).

The first one has absolutely positioned View below the canvas, but you can see that weird behaviour in the second example more clearly (the only change is the background color of the View that contains both). I changed the colors so the alpha was less than 1.0 - in that way you can clearly see what happens in terms of blending. You can also change the alpha in the minimal reproduction if you want to test it out.

I also have to say that this behaviour is present only on iOS - the android version behaves even weirder - Canvas looks as if it were skewed in X and Y directions, and the origin of the canvas (0,0) is transformed with the skewing.

Screen.Recording.2025-10-09.at.15.30.34.mov
Screen.Recording.2025-10-09.at.15.34.47.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions