Skip to content

Commit

Permalink
Fix for selecting the correct diagramPadding for flowcharts
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Aug 23, 2024
1 parent fdf376f commit 48fd76e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const draw = async function (text: string, id: string, _version: string,
data4Layout.diagramId = id;
log.debug('REF1:', data4Layout);
await render(data4Layout, svg);
const padding = data4Layout.config.flowchart?.padding ?? 8;
const padding = data4Layout.config.flowchart?.diagramPadding ?? 8;
utils.insertTitle(
svg,
'flowchartTitleText',
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/rendering-util/setupViewPortForSVG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const setupViewPortForSVG = (
svg.attr('viewBox', viewBox);

// Log the viewBox configuration for debugging
log.debug(`viewBox configured: ${viewBox}`);
log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`);
};

const calculateDimensionsWithPadding = (svg: SVG, padding: number) => {
Expand Down

0 comments on commit 48fd76e

Please sign in to comment.