fix: Fixed git graph to use global setting if useMaxWidth option is not set

This commit is contained in:
uttk 2022-10-17 03:07:10 +00:00
parent 627ddc0774
commit 319f925bdd

View File

@ -495,7 +495,8 @@ const drawBranches = (svg, branches) => {
*/
export const draw = function (txt, id, ver, diagObj) {
clear();
const gitGraphConfig = getConfig().gitGraph;
const conf = getConfig();
const gitGraphConfig = conf.gitGraph;
// try {
log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver);
@ -522,7 +523,12 @@ export const draw = function (txt, id, ver, diagObj) {
drawCommits(diagram, allCommitsDict, true);
// Setup the view box and size of the svg element
setupGraphViewbox(undefined, diagram, gitGraphConfig.diagramPadding, gitGraphConfig.useMaxWidth);
setupGraphViewbox(
undefined,
diagram,
gitGraphConfig.diagramPadding,
gitGraphConfig.useMaxWidth ?? conf.useMaxWidth
);
};
export default {