fix: prevent rich text labels from inheriting line dash styles - #4676
fix: prevent rich text labels from inheriting line dash styles#4676biubiukam wants to merge 2 commits into
Conversation
xuefei1313
left a comment
There was a problem hiding this comment.
🦞 Aime Bot Review
改动摘要
- 仓库:VisActor/VChart
- PR:#4676 fix: prevent rich text labels from inheriting line dash styles
- 作者:@biubiukam
- 创建时间:2026-08-29 08:53:42+08:00
代码观察
- 变更规模:3 files, +13/-1
- 变更文件(Top 12):
common/changes/@visactor/vchart/fix-issue-4595-richtext-line-dash_2026-08-28.json(added, +11/-0)packages/vchart/__tests__/unit/mark/text.test.ts(modified, +1/-1)packages/vchart/src/mark/text.ts(modified, +1/-0)
建议
- 整体看起来结构清晰;建议自测覆盖关键渲染/交互路径,并在描述中补充变更动机与影响范围。
合并建议
建议在自测通过、并确认风险可控后合并 ✅。若这是行为修复/用户可见变更,建议补充 changelog/文档说明。
|
🦞 Aime Bot Review(补充点评) 根因确认
具体建议
合并建议改动小而聚焦,changeset(patch)与 changelog 齐全,单测也同步更新了。补上回归用例(或说明已手动验证 issue 复现场景)后建议合并 ✅。 请确认 @biubiukam 是否方便补充第 1 点的渲染层回归测试~ |
|
已补充评审建议中的渲染层回归用例:真实渲染 scatter 图表,先绘制 lineDash 为 [10, 10] 的 point,再绘制带 stroke 的 rich text label;断言 rich text graphic 的默认 lineDash 为 [],并验证 label 的 strokeText 调用前最后一次 setLineDash 调用参数为 []。同时将默认样式测试名修正为 text mark initial style。聚焦测试与编译已通过。 |
The rendering layer regression use case in the review suggestions has been supplemented: to truly render the scatter chart, first draw the point of , and then draw the rich text label with stroke; assert that the default of rich text graphic is , and verify that the last time before label is . At the same time, the default style test name is corrected to . Focus testing and compilation passed. |
🤔 This is a ...
🔗 Related issue link
Fixes #4595
🔗 Related PR link
None.
🐞 Bugserver case id
N/A
💡 Background and solution
Rich text labels could inherit a dashed
lineDashcanvas state from the graphic rendered immediately before them, so a stroked label appeared dashed even when no dash pattern was configured for the text mark.This change gives
TextMarkan explicit emptylineDashdefault. The text mark now clears any inherited dash pattern before rich text is rendered, while an explicitly configured dash pattern remains unchanged.The regression coverage renders a real scatter chart with a dashed point followed by a stroked rich text label. It verifies the rich text graphic receives
lineDash: []and that the finalsetLineDashcall beforestrokeText('label')resets the canvas state.📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
Set an explicit empty dash pattern on text marks and add a rendering regression test so rich text label strokes do not inherit a preceding point's dash state.
🔍 Walkthrough
lineDash: []to the defaultTextMarkstyle.✅ Verification
The package-wide test run reached 400 passing tests; the existing
__tests__/unit/extension/pictogram-size.test.tssuite remains blocked by unrelated@visactor/vcharttype-resolution errors invchart-extension.