Skip to content

Commit

Permalink
Workaround for FF rendering/bbox race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Sep 28, 2022
1 parent 00dbdad commit eca82bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/svg/SVGEdge.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ export default class SVGEdge extends EventEmitter {

if (label && firstTag) {
const text = label.find('text').text(firstTag);
const { width, height } = text[0][0].node.getBBox();

label.find('rect')
setTimeout(() => {
const { width, height } = text[0][0].node.getBBox();

label.find('rect')
.attr('x', -5.5)
.attr('y', - Math.round(height / 2) - 1.5)
.attr('rx', 2)
.attr('ry', 2)
.attr('width', Math.round(width) + 10)
.attr('height', Math.round(height) + 4);
}, 1);

label.attr('style', null);
} else {
Expand Down

0 comments on commit eca82bd

Please sign in to comment.