Skip to content

Commit

Permalink
Merge pull request #1563 from VisActor/fix/richtext-lineWidth
Browse files Browse the repository at this point in the history
fix: fix issue where not work when lineWidth is set to 0
  • Loading branch information
xile611 authored Nov 20, 2024
2 parents ad4fc01 + dcfdef2 commit 5b30145
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: fix issue where not work when lineWidth is set to 0",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
3 changes: 2 additions & 1 deletion packages/vrender-core/src/graphic/richtext/paragraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ export default class Paragraph {
baseline = 0;
}

if (this.character.stroke) {
const { lineWidth = 1 } = this.character;
if (this.character.stroke && lineWidth) {
applyStrokeStyle(ctx, this.character);
ctx.strokeText(text, left, baseline);
}
Expand Down

0 comments on commit 5b30145

Please sign in to comment.