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

[next] Can we invert the draw paths? #256

Closed
chrisbanes opened this issue Jul 13, 2024 · 0 comments
Closed

[next] Can we invert the draw paths? #256

chrisbanes opened this issue Jul 13, 2024 · 0 comments

Comments

@chrisbanes
Copy link
Owner

Currently Haze is all smoke and mirrors, as it draws all of the blurred areas in the haze layout node. The hazeChild nodes just update the size, shape, etc, which the haze modifier reads, to know where to draw.

What if we invert this, so that the haze node creates a graphics layer and puts it in the HazeState. Each hazeChild then uses that graphics layer to apply the blurred effect locally in the relevant layout node.

This could fix a number of issues, including #213, #229 and #245, which all boil down to the fact that we don't draw in the child nodes.

Even if this works, there is a downside though: anything which draws in-between the haze and hazeChild would be ignored. This is because the children are directly drawing the haze parent.

I see two options to workaround this:

  1. Easy: make this 'mode' optional.
  2. Harder: We add a hazeAncestor modifier which devs have to apply to intermediary ancestors. This modifier will basically do the same thing as haze and stuff a graphics layer into the HazeState. The hazeChild would then draw all of the ancestor layers in the effect.

Option 2 is out of scope for the initial release, but can be followed up on. Again, even if this works.

chrisbanes added a commit that referenced this issue Jul 16, 2024
Currently Haze is all smoke and mirrors, as it draws all of the blurred
areas in the haze layout node. The hazeChild nodes just update the size,
shape, etc, which the haze modifier reads, to know where to draw.

This PR inverts this, so that the haze node creates a graphics layer and
puts it in the HazeState. Each hazeChild then uses that graphics layer
to apply the blurred effect locally in the relevant layout node.

Fixes #213, #229, #245, #256
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

No branches or pull requests

1 participant