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

Fix/box-shadow #66

Merged
merged 3 commits into from
Mar 17, 2021
Merged

Fix/box-shadow #66

merged 3 commits into from
Mar 17, 2021

Conversation

temper357
Copy link
Contributor

@temper357 temper357 commented Mar 17, 2021

  • 问题:修复 box-shadow 与浏览器不一致的效果
    1. element 无 background 时 box-shadow 会在背景处透出
    2. 有 blurRadius 时 blur 效果比浏览器宽
  • fix:
    1. 使用 drawPath 替代 drawRect,对 box shadow 区域进行裁剪,减去 border rect 的区域
    2. shadow 的 blur 效果对应的 MaskFilter 参数 blur sigma 调整成与 W3C 一致的值,1 /2 blur radius 半径
    3. 为以后支持 inset 类型考虑,box shadow 需要覆盖在 background-image 之上,box shadow 的 paint 顺序调整到最后

Copy link
Member

@wssgcg1213 wssgcg1213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@andycall
Copy link
Member

lgtm

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

Successfully merging this pull request may close these issues.

3 participants