Skip to content

Commit

Permalink
fix: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonneyx committed May 7, 2024
1 parent 5daf945 commit 8001909
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/g6/__tests__/unit/plugins/tooltip.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('plugin tooltip', () => {
it('show tooltip by id', async () => {
const graph = await createDemoGraph(pluginTooltip);
const tooltip = graph.getPluginInstance<Tooltip>('tooltip');
tooltip.showTooltipById('6', 'node');
tooltip.showById('6');
await expect(graph).toMatchSnapshot(__filename, 'show-tooltip-by-id');
graph.destroy();
});
Expand Down
3 changes: 2 additions & 1 deletion packages/g6/src/elements/shapes/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ export class Label extends BaseShape<LabelStyleProps> {
} = this.shapeMap.text.getGeometryBounds();

const [top, right, bottom, left] = parsePadding(padding);
const totalWidth = halfWidth * 2 + left + right;

Object.assign(backgroundStyle, {
x: minX - left,
y: minY - top,
width: wordWrap ? Math.min(halfWidth * 2 + left + right, wordWrapWidth) : halfWidth * 2 + left + right,
width: wordWrap ? Math.min(totalWidth, wordWrapWidth) : totalWidth,
height: halfHeight * 2 + top + bottom,
});

Expand Down

0 comments on commit 8001909

Please sign in to comment.