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

Shadow with negative spread doesn't match figma #466

Open
AmjadHD opened this issue Jul 11, 2022 · 3 comments
Open

Shadow with negative spread doesn't match figma #466

AmjadHD opened this issue Jul 11, 2022 · 3 comments

Comments

@AmjadHD
Copy link
Contributor

AmjadHD commented Jul 11, 2022

A continuation for #372 (comment)

Figma:

  1. create a 47x47px frame
  2. add a 29x29px rectangle at x=y=9
  3. set the corner radii to 6px
  4. set the fill to white and the opacity to 0.001% (it should become 0% when confirmed).

image
6. export the frame

Pixie:

proc drawShadow() =
  let image = newImage(47, 47)

  let r = 6f32
  let path = newPath()
  path.roundedRect(rect(9, 9, 29, 29), r, r, r, r)

  image.fillPath(path, "white")

  image.shadow(
    offset = vec2(0, 0),
    spread = -2,
    blur = 0,
    color = color(0, 0, 0, 0.4)
  ).writeFile("shadow_pixie_negative_spread_no_blur.png")

Figma:
shadow_figma_negative_spread_no_blur

  • 25x25px rect
  • corner radius is 4px (6 - 2):

Pixie:
shadow_pixie_negative_spread_no_blur

  • 25x25px rect
  • corner radius is 6px (unchanged):
@AmjadHD
Copy link
Contributor Author

AmjadHD commented Jul 12, 2022

@treeform
Copy link
Owner

Thank you for the issue!

You are totally right. I have looked into this and we don't match.

We will fix this eventually.

@AmjadHD
Copy link
Contributor Author

AmjadHD commented Aug 13, 2022

I believe shadow()'s logic is correct as is, Are you going to add box-shadow() function ?

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

2 participants