chore: Fix configAPI

This commit is contained in:
Sidharth Vinod 2023-12-07 01:04:12 +05:30
parent 886eda92a9
commit 85774b7e46
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD

View File

@ -317,7 +317,7 @@ async function boundMessage(_diagram, msgModel): number {
const lines = common.splitBreaks(message).length;
const isKatexMsg = hasKatex(message);
const textDims = isKatexMsg
? await calculateMathMLDimensions(message, configApi.getConfig())
? await calculateMathMLDimensions(message, getConfig())
: utils.calculateTextDimensions(message, messageFont(conf));
if (!isKatexMsg) {
@ -1160,7 +1160,7 @@ async function getMaxMessageWidthPerActor(
? utils.wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont)
: msg.message;
const messageDimensions = hasKatex(wrappedMessage)
? await calculateMathMLDimensions(msg.message, configApi.getConfig())
? await calculateMathMLDimensions(msg.message, getConfig())
: utils.calculateTextDimensions(wrappedMessage, textFont);
const messageWidth = messageDimensions.width + 2 * conf.wrapPadding;
@ -1273,7 +1273,7 @@ async function calculateActorMargins(
);
}
const actDims = hasKatex(actor.description)
? await calculateMathMLDimensions(actor.description, configApi.getConfig())
? await calculateMathMLDimensions(actor.description, getConfig())
: utils.calculateTextDimensions(actor.description, actorFont(conf));
actor.width = actor.wrap
@ -1339,7 +1339,7 @@ const buildNoteModel = async function (msg, actors, diagObj) {
const shouldWrap = msg.wrap && msg.message;
let textDimensions: { width: number; height: number; lineHeight?: number } = hasKatex(msg.message)
? await calculateMathMLDimensions(msg.message, configApi.getConfig())
? await calculateMathMLDimensions(msg.message, getConfig())
: utils.calculateTextDimensions(
shouldWrap ? utils.wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message,
noteFont(conf)