Skip to content

Conversation

@shiqiWang0
Copy link
Collaborator

@shiqiWang0 shiqiWang0 commented Nov 11, 2024

变更类型

请选择以下选项以描述 PR 的类型:

  • Bug 修复(修复现有问题)
  • 新功能(添加了一个功能)
  • 代码优化(性能改进、代码重构)
  • 文档更新
  • 单测新增或修改
  • 其他(请说明):

相关问题

关联 issue: #466

变更内容

通过 svg 进行处理, 替换原本通过 css 进行缩放实现 10px 的效果

详细描述

技术方案
https://dtstack.yuque.com/rd-center/tqk74v/bddbmase2lcqpszb

对应 Previewer

Copy link
Collaborator

@LuckyFBB LuckyFBB left a comment

Choose a reason for hiding this comment

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

+1

@LuckyFBB LuckyFBB requested a review from mortalYoung November 12, 2024 11:27
@jin-sir
Copy link
Collaborator

jin-sir commented Nov 13, 2024

上面的 paddingWidth 设置为 9,下面的 text 元素设置的 x 又是 4 ,是不是有问题?

@shiqiWang0
Copy link
Collaborator Author

上面的 paddingWidth 设置为 9,下面的 text 元素设置的 x 又是 4 ,是不是有问题?

text 在画布偏移 4的位置绘制, 那计算出来的 width 应该在该基础上 加 4 * 2

<rect
x="0.5"
y="0.5"
width={width - 1}
Copy link
Collaborator

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")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这个 会提取到 hook 里面, 处理掉

@jin-sir jin-sir self-requested a review November 22, 2024 02:59
@jin-sir jin-sir merged commit 09c4c77 into master Nov 22, 2024
1 check passed
@LuckyFBB LuckyFBB deleted the feat_4.x_tinyTag branch August 7, 2025 12:01
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.

5 participants