Skip to content

Commit

Permalink
fix: fix issue with position in html attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Jan 5, 2024
1 parent 387b753 commit 468d75f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: fix issue with position in html attribute",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ export class HtmlAttributePlugin implements IPlugin {
let left: number = 0;
let top: number = 0;
if (anchorType === 'position') {
const matrix = graphic.transMatrix;
const matrix = graphic.globalTransMatrix;
left = matrix.e;
top = matrix.f;
} else {
const b = graphic.AABBBounds;
const b = graphic.globalAABBBounds;
left = b.x1;
top = b.y1;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender/__tests__/browser/src/pages/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const page = () => {
y: (Math.floor((i * 100) / 500) + 1) * 100,
size: 60,
html: {
dom: '<div xmlns="http://www.w3.org/1999/xhtml">这是abcdefg</div>',
dom: '<div>这是abcdefg</div>',
width: 60,
height: 60
},
Expand Down

0 comments on commit 468d75f

Please sign in to comment.