diff --git a/common/changes/@visactor/vrender-core/develop_2024-01-16-07-05.json b/common/changes/@visactor/vrender-core/develop_2024-01-16-07-05.json new file mode 100644 index 000000000..fffa65a59 --- /dev/null +++ b/common/changes/@visactor/vrender-core/develop_2024-01-16-07-05.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-core", + "comment": "fix: fix issue with html attribute", + "type": "none" + } + ], + "packageName": "@visactor/vrender-core" +} \ No newline at end of file diff --git a/packages/vrender-core/src/plugins/builtin-plugin/html-attribute-plugin.ts b/packages/vrender-core/src/plugins/builtin-plugin/html-attribute-plugin.ts index 6168614dc..138caf775 100644 --- a/packages/vrender-core/src/plugins/builtin-plugin/html-attribute-plugin.ts +++ b/packages/vrender-core/src/plugins/builtin-plugin/html-attribute-plugin.ts @@ -127,12 +127,12 @@ export class HtmlAttributePlugin implements IPlugin { } let left: number = 0; let top: number = 0; - if (anchorType === 'position') { + const b = graphic.globalAABBBounds; + if (anchorType === 'position' || b.empty()) { const matrix = graphic.globalTransMatrix; left = matrix.e; top = matrix.f; } else { - const b = graphic.globalAABBBounds; left = b.x1; top = b.y1; }