mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
conf.messageFont() would have a different cacheKey based on the cacheKey calculations done in this particular branch. This will be normalized with the memoize PR about to be created.
This commit is contained in:
@@ -250,7 +250,7 @@ const drawNote = function(elem, noteModel) {
|
|||||||
const drawMessage = function(g, msgModel) {
|
const drawMessage = function(g, msgModel) {
|
||||||
const { startx, stopx, starty, message, type, sequenceIndex, wrap } = msgModel;
|
const { startx, stopx, starty, message, type, sequenceIndex, wrap } = msgModel;
|
||||||
const lines = message.split(common.lineBreakRegex).length;
|
const lines = message.split(common.lineBreakRegex).length;
|
||||||
let textDims = utils.calculateTextDimensions(message, conf);
|
let textDims = utils.calculateTextDimensions(message, conf.messageFont());
|
||||||
const lineHeight = textDims.height / lines;
|
const lineHeight = textDims.height / lines;
|
||||||
msgModel.height += lineHeight;
|
msgModel.height += lineHeight;
|
||||||
|
|
||||||
@@ -968,17 +968,13 @@ const buildMessageModel = function(msg, actors) {
|
|||||||
if (msg.wrap && msg.message && !common.lineBreakRegex.test(msg.message)) {
|
if (msg.wrap && msg.message && !common.lineBreakRegex.test(msg.message)) {
|
||||||
msg.message = utils.wrapLabel(
|
msg.message = utils.wrapLabel(
|
||||||
msg.message,
|
msg.message,
|
||||||
Math.max(
|
Math.max(boundedWidth + 2 * conf.wrapPadding, conf.width),
|
||||||
msgDims.width + 2 * conf.wrapPadding,
|
|
||||||
boundedWidth + 2 * conf.wrapPadding,
|
|
||||||
conf.width
|
|
||||||
),
|
|
||||||
conf.messageFont()
|
conf.messageFont()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
width: Math.max(
|
width: Math.max(
|
||||||
msgDims.width + 2 * conf.wrapPadding,
|
msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding,
|
||||||
boundedWidth + 2 * conf.wrapPadding,
|
boundedWidth + 2 * conf.wrapPadding,
|
||||||
conf.width
|
conf.width
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user