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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine "layer visuals affecting" views #42

Open
helje5 opened this issue Jul 26, 2019 · 0 comments
Open

Combine "layer visuals affecting" views #42

helje5 opened this issue Jul 26, 2019 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@helje5
Copy link
Member

helje5 commented Jul 26, 2019

As mentioned in: #40

We currently have the issue that visual affecting views do not modify a single div, but result in multiple divs. So this:

      Text("馃馃崬")
        .padding(.all)
        .background(.green, cornerRadius: 12)
        .shadow(color: .lightGray, radius: 5, x: 2, y: 2)

Results in:
Screen Shot 2019-07-26 at 15 42 21

I think the solution is to have .background, .shadow and the likes return a single "Style patching tree node".

Important: Layout nodes like .padding or .frame are different! They need to result in new divs because the ordering matters (or maybe they can combine if the ordering would lead to the same result). The old:

      Text("馃馃崬")
        .padding(.all)
        .background(.green, cornerRadius: 12)

      Text("馃馃崬")
        .background(.green, cornerRadius: 12)
        .padding(.all)
@helje5 helje5 added bug Something isn't working help wanted Extra attention is needed labels Jul 26, 2019
Samuel-IH added a commit to Samuel-IH/SwiftWebUI that referenced this issue Sep 17, 2020
Samuel-IH added a commit to Samuel-IH/SwiftWebUI that referenced this issue Sep 17, 2020
SwiftWebUI#42
(cherry picked from commit 777e1bb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant