Skip to content

Commit

Permalink
Fix SVG width
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Nov 15, 2023
1 parent 0d7644c commit 088fc39
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/mermaid/src/diagrams/packet/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Diagram } from '../../Diagram.js';
import type { PacketDiagramConfig } from '../../config.type.js';
import type { DiagramRenderer, DrawDefinition, Group, SVG } from '../../diagram-api/types.js';
import { selectSvgElement } from '../../rendering-util/selectSvgElement.js';
import { configureSvgSize } from '../../setupGraphViewbox.js';
import type { PacketDB, PacketWord } from './types.js';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand All @@ -17,8 +16,8 @@ const draw: DrawDefinition = (_text, id, _version, diagram: Diagram) => {
const svgWidth = bitWidth * bitsPerRow + 2;
const svg: SVG = selectSvgElement(id);

configureSvgSize(svg, svgHeight, svgWidth, true);
svg.attr('height', svgHeight + 'px');
svg.attr('width', '100%');
svg.attr('viewbox', `0 0 ${svgWidth} ${svgHeight}`);

for (const [row, packet] of words.entries()) {
drawWord(svg, packet, row, config);
Expand Down

0 comments on commit 088fc39

Please sign in to comment.