mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 10:20:06 +02:00
chore: Fix configAPI
This commit is contained in:
@@ -317,7 +317,7 @@ async function boundMessage(_diagram, msgModel): number {
|
|||||||
const lines = common.splitBreaks(message).length;
|
const lines = common.splitBreaks(message).length;
|
||||||
const isKatexMsg = hasKatex(message);
|
const isKatexMsg = hasKatex(message);
|
||||||
const textDims = isKatexMsg
|
const textDims = isKatexMsg
|
||||||
? await calculateMathMLDimensions(message, configApi.getConfig())
|
? await calculateMathMLDimensions(message, getConfig())
|
||||||
: utils.calculateTextDimensions(message, messageFont(conf));
|
: utils.calculateTextDimensions(message, messageFont(conf));
|
||||||
|
|
||||||
if (!isKatexMsg) {
|
if (!isKatexMsg) {
|
||||||
@@ -1160,7 +1160,7 @@ async function getMaxMessageWidthPerActor(
|
|||||||
? utils.wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont)
|
? utils.wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont)
|
||||||
: msg.message;
|
: msg.message;
|
||||||
const messageDimensions = hasKatex(wrappedMessage)
|
const messageDimensions = hasKatex(wrappedMessage)
|
||||||
? await calculateMathMLDimensions(msg.message, configApi.getConfig())
|
? await calculateMathMLDimensions(msg.message, getConfig())
|
||||||
: utils.calculateTextDimensions(wrappedMessage, textFont);
|
: utils.calculateTextDimensions(wrappedMessage, textFont);
|
||||||
const messageWidth = messageDimensions.width + 2 * conf.wrapPadding;
|
const messageWidth = messageDimensions.width + 2 * conf.wrapPadding;
|
||||||
|
|
||||||
@@ -1273,7 +1273,7 @@ async function calculateActorMargins(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
const actDims = hasKatex(actor.description)
|
const actDims = hasKatex(actor.description)
|
||||||
? await calculateMathMLDimensions(actor.description, configApi.getConfig())
|
? await calculateMathMLDimensions(actor.description, getConfig())
|
||||||
: utils.calculateTextDimensions(actor.description, actorFont(conf));
|
: utils.calculateTextDimensions(actor.description, actorFont(conf));
|
||||||
|
|
||||||
actor.width = actor.wrap
|
actor.width = actor.wrap
|
||||||
@@ -1339,7 +1339,7 @@ const buildNoteModel = async function (msg, actors, diagObj) {
|
|||||||
const shouldWrap = msg.wrap && msg.message;
|
const shouldWrap = msg.wrap && msg.message;
|
||||||
|
|
||||||
let textDimensions: { width: number; height: number; lineHeight?: number } = hasKatex(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(
|
: utils.calculateTextDimensions(
|
||||||
shouldWrap ? utils.wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message,
|
shouldWrap ? utils.wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message,
|
||||||
noteFont(conf)
|
noteFont(conf)
|
||||||
|
Reference in New Issue
Block a user