Skip to content

Commit 14601b7

Browse files
authored
Merge pull request #5865 from mermaid-js/develop
Pre-Release
2 parents e44eb52 + 7a86fd7 commit 14601b7

File tree

4 files changed

+351
-591
lines changed

4 files changed

+351
-591
lines changed

.changeset/dry-plums-glow.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'mermaid': patch
3+
---
4+
5+
Fix for issue with calculation of label width when using in firefox

packages/mermaid/src/diagrams/sequence/svgDraw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export const fixLifeLineHeights = (diagram, actors, actorKeys, conf) => {
329329
const drawActorTypeParticipant = function (elem, actor, conf, isFooter) {
330330
const actorY = isFooter ? actor.stopy : actor.starty;
331331
const center = actor.x + actor.width / 2;
332-
const centerY = actorY + 5;
332+
const centerY = actorY + actor.height;
333333

334334
const boxplusLineGroup = elem.append('g').lower();
335335
var g = boxplusLineGroup;

packages/mermaid/src/rendering-util/createText.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ function applyStyle(dom, styleFn) {
2020

2121
async function addHtmlSpan(element, node, width, classes, addBackground = false) {
2222
const fo = element.append('foreignObject');
23+
// This is not the final width but used in order to make sure the foreign
24+
// object in firefox gets a width at all. The final width is fetched from the div
25+
fo.attr('width', `${10 * width}px`);
26+
fo.attr('height', `${10 * width}px`);
27+
2328
const div = fo.append('xhtml:div');
2429
let label = node.label;
2530
if (node.label && hasKatex(node.label)) {
@@ -201,7 +206,7 @@ export const createText = async (
201206
} = {},
202207
config: MermaidConfig
203208
) => {
204-
log.info(
209+
log.debug(
205210
'XYZ createText',
206211
text,
207212
style,

0 commit comments

Comments
 (0)