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

🐛[BUG] linear-gradient解析错误 #96

Closed
Tracked by #135
8zf opened this issue Mar 24, 2021 · 0 comments
Closed
Tracked by #135

🐛[BUG] linear-gradient解析错误 #96

8zf opened this issue Mar 24, 2021 · 0 comments

Comments

@8zf
Copy link

8zf commented Mar 24, 2021

🐛 bug 描述

样式信息如:"background-image: linear-gradient(1.5708rad, rgb(255, 208, 0), rgb(255, 189, 0));",无法正确解析
报错:Unable to parse color from string: 1.5708rad

📷 复现步骤

// 确保node中有上述的style
nodeToSketchSymbol(node).then(symbol => {
  const sketchJSON = symbol.toSketchJSON()
  console.log('sketchJSON: ', sketchJSON)
})

🏞 期望结果

解析正确

© 版本信息

  • html2sketch 版本: 0.4.6
  • 浏览器环境:版本 89.0.4389.90(正式版本) (x86_64)
  • 开发环境: mac OS 10.14

🚑 其他信息

初步判断问题代码:https://github.com/ant-design/html2sketch/blob/master/src/models/Style/Gradient.ts#L37
貌似没有考虑linear-gradient的angle参数

@arvinxx arvinxx mentioned this issue May 8, 2021
6 tasks
github-actions bot pushed a commit that referenced this issue Sep 13, 2021
# [1.0.0-beta.8](v1.0.0-beta.7...v1.0.0-beta.8) (2021-09-13)

### ✨ Features

* support rad angle line-gradient ([9860090](9860090)), closes [#96](#96)
@arvinxx arvinxx closed this as completed Sep 13, 2021
github-actions bot pushed a commit that referenced this issue Feb 9, 2023
# [1.0.0](v0.4.7...v1.0.0) (2023-02-09)

### ♻ Code Refactoring

* rename the symbol function ([09d0de9](09d0de9))

### ✨ Features

* input support overflow ([0ff7b55](0ff7b55)), closes [#177](#177)
* support almost full css transform ([f7bb06d](f7bb06d)), closes [#148](#148)
* support overflow element ([f4b017b](f4b017b)), closes [#178](#178)
* support rad angle line-gradient ([9860090](9860090)), closes [#96](#96)
* support rotate & clip-path ([35f6628](35f6628)), closes [#180](#180)
* 优化抓取 base64 图片方法 ([07dd128](07dd128))
* 提供自定义 fetch 方法的能力 ([28ed276](28ed276))
* 新增固定宽高的能力 ([f2df2e5](f2df2e5))

### 🐛 Bug Fixes

* adjust text and svg resizing constraint ([9fc8970](9fc8970))
* fix absolute position margin parsing ([120ba39](120ba39))
* fix overflow hidden node use clipping mask ([defb941](defb941))
* fix overflow hidden node use clipping mask ([055f25d](055f25d))
* fix password input text ([c8ff928](c8ff928))
* fix placeholder parsing without css rules ([505a390](505a390))
* fix position bug due to sketch text align parsing error ([1dce98f](1dce98f)), closes [#51](#51)
* fix pseudo elt style issue and add test ([5c727a3](5c727a3))
* fix resizingConstraint func and update test ([c39f843](c39f843))
* gradient parse in safari ([aa374e5](aa374e5)), closes [#185](#185)
* parse linear-gradient ([90f3ed8](90f3ed8)), closes [#184](#184)
* set default resizingConstraint to left and top ([f897275](f897275))
* should parse textarea value and placeholder ([06d70ac](06d70ac)), closes [#161](#161)
* single child overflow should not be mask ([1acab12](1acab12)), closes [#181](#181)
* try to fix babel problem ([398f825](398f825))
* 修正 textStyle 缺失导致修改文本造成报错的问题 ([1a44244](1a44244))

### 💥 BREAKING CHANGES

* rename `nodeToSketchSymbol` to nodeToSymbol
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