ant-design/html2sketch

🐛[BUG]a标签在sketch插件中提供的web中调用getBoundingClientRect方法返回值问题

Open

#47 opened on Oct 28, 2020

 (6 comments) (0 reactions) (0 assignees)TypeScript (27 forks)github user discovery
help wanted

Repository metrics

Stars
 (180 stars)
PR merge metrics
 (PR metrics pending)

Description

🐛 bug 描述

a标签在sketch插件中提供的web中执行
const bcr = node.getBoundingClientRect(); 这段代码的时候,不能返回准确的自身rect值,返回的是父节点的值,有什么能替换的方法么

modify

上面描述的不准确,返回的还是自身的值 但是因为换行返回的rect被撑开了 在设置textLayer的x和y的时候就会出现不准确的情况 test

如图得到的rect就是红色的框

📷 复现步骤

在转换如下节点时复现的问题

<span>
阅读
<a >xxxx协议</a>
</span>

Contributor guide