TokamakUI / Tokamak

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
Apache License 2.0
2.62k stars 111 forks source link

Add HTML renderer support for AngularGradient #444

Closed ezraberch closed 3 years ago

ezraberch commented 3 years ago

This PR adds HTML renderer support for AngularGradient. Since SVG gradients do not support angular gradients, CSS conic-gradient is used instead.

Additionally, UnitPoint constants have been changed to match SwiftUI (fixes #443).

MaxDesiatov commented 3 years ago

Do snapshot tests pass for you locally? There's a mismatch on CI, so I wonder if this is reproducible for you, or maybe we should tweak flags passed to Edge again? Some mismatches are caused by bitness and/or resolution inconsistencies on different devices. I had to hardcode those parameters, but maybe there's still something missing?

ezraberch commented 3 years ago

They do pass locally, on both 12.5.1 and 13 beta. It seems the upload failed screenshots step isn't working, so I can't see what exactly the difference is.

MaxDesiatov commented 3 years ago

I think we need to change the pattern here from RenderingTests to just '*Tests' (with single-quotes to avoid the in-place glob expansion) https://github.com/TokamakUI/Tokamak/blob/e1fcd180d7fac3632c8cfd8511149fe52f49d5ae/.github/workflows/ci.yml#L40

This line also needs to be updated to *Tests probably? I hope this property supports glob star expansions too https://github.com/TokamakUI/Tokamak/blob/e1fcd180d7fac3632c8cfd8511149fe52f49d5ae/.github/workflows/ci.yml#L64

That should be able to find and upload failed snapshots from /var/folders correctly.

ezraberch commented 3 years ago

I've updated the test to allow either version of the image. Version A is what I get locally. Version B is what the CI gets. They are indistinguishable visually.

MaxDesiatov commented 3 years ago

Did you try to use compare (available if you do brew install imagemagick) to generate a pixel diff for these images? Maybe that could point to what exactly is going on there?

ezraberch commented 3 years ago

I did; the one place it shows a difference isn't even in the new angular gradient section.

result