Skip to content

Commit

Permalink
fix: clear richtext bounds while it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Feb 8, 2025
1 parent 4ba5d2c commit 57d638e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: clear richtext bounds while it is empty",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
4 changes: 4 additions & 0 deletions packages/vrender-core/src/graphic/richtext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ export class RichText extends Graphic<IRichTextGraphicAttribute> implements IRic
application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds);
}
application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, false, this);
// 都为0的话,就直接clear
if (aabbBounds.width() === 0 && aabbBounds.height() === 0) {
aabbBounds.clear();
}
return aabbBounds;
}

Expand Down

0 comments on commit 57d638e

Please sign in to comment.