ant-design / ant-design/html2sketch
🐛[BUG]a标签在sketch插件中提供的web中调用getBoundingClientRect方法返回值问题
- Dominant language
- TypeScript
- Stars
- 179
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
### 🐛 bug 描述
a标签在sketch插件中提供的web中执行
const bcr = node.getBoundingClientRect();
这段代码的时候,不能返回准确的自身rect值,返回的是父节点的值,有什么能替换的方法么
### modify
上面描述的不准确,返回的还是自身的值 但是因为换行返回的rect被撑开了 在设置textLayer的x和y的时候就会出现不准确的情况

如图得到的rect就是红色的框
### 📷 复现步骤
在转换如下节点时复现的问题
```html
阅读
xxxx协议
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the HTML-to-Sketch conversion for the provided span and a-node snippet, focusing on how getBoundingClientRect is used for textLayer positioning. Reproduce the wrapping case and verify that the resulting x and y coordinates match the visible link bounds rather than the red expanded rectangle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100