-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat(tinytag): replace svg to render #517
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
上面的 paddingWidth 设置为 9,下面的 text 元素设置的 x 又是 4 ,是不是有问题? |
text 在画布偏移 4的位置绘制, 那计算出来的 width 应该在该基础上 加 4 * 2 |
src/tinyTag/index.tsx
Outdated
<rect | ||
x="0.5" | ||
y="0.5" | ||
width={width - 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里加个判断吧?width初始值为0,在第一次渲染时,rect的width变成了 -1,会出现错误
Error: attribute width: A negative value is not valid. ("-1")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 会提取到 hook 里面, 处理掉
变更类型
请选择以下选项以描述 PR 的类型:
相关问题
关联 issue: #466
变更内容
通过 svg 进行处理, 替换原本通过 css 进行缩放实现 10px 的效果
详细描述
技术方案
https://dtstack.yuque.com/rd-center/tqk74v/bddbmase2lcqpszb
对应 Previewer