Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-Release #5865

Merged
merged 10 commits into from
Sep 16, 2024
5 changes: 5 additions & 0 deletions .changeset/dry-plums-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

Fix for issue with calculation of label width when using in firefox
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/sequence/svgDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export const fixLifeLineHeights = (diagram, actors, actorKeys, conf) => {
const drawActorTypeParticipant = function (elem, actor, conf, isFooter) {
const actorY = isFooter ? actor.stopy : actor.starty;
const center = actor.x + actor.width / 2;
const centerY = actorY + 5;
const centerY = actorY + actor.height;

const boxplusLineGroup = elem.append('g').lower();
var g = boxplusLineGroup;
Expand Down
7 changes: 6 additions & 1 deletion packages/mermaid/src/rendering-util/createText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ function applyStyle(dom, styleFn) {

async function addHtmlSpan(element, node, width, classes, addBackground = false) {
const fo = element.append('foreignObject');
// This is not the final width but used in order to make sure the foreign
// object in firefox gets a width at all. The final width is fetched from the div
fo.attr('width', `${10 * width}px`);
fo.attr('height', `${10 * width}px`);

const div = fo.append('xhtml:div');
let label = node.label;
if (node.label && hasKatex(node.label)) {
Expand Down Expand Up @@ -201,7 +206,7 @@ export const createText = async (
} = {},
config: MermaidConfig
) => {
log.info(
log.debug(
'XYZ createText',
text,
style,
Expand Down
Loading
Loading