Skip to content

Commit 57d638e

Browse files
committed
fix: clear richtext bounds while it is empty
1 parent 4ba5d2c commit 57d638e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@visactor/vrender-core",
5+
"comment": "fix: clear richtext bounds while it is empty",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@visactor/vrender-core"
10+
}

packages/vrender-core/src/graphic/richtext.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ export class RichText extends Graphic<IRichTextGraphicAttribute> implements IRic
318318
application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds);
319319
}
320320
application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, false, this);
321+
// 都为0的话,就直接clear
322+
if (aabbBounds.width() === 0 && aabbBounds.height() === 0) {
323+
aabbBounds.clear();
324+
}
321325
return aabbBounds;
322326
}
323327

0 commit comments

Comments
 (0)