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:
chris moran 2020-06-30 07:18:28 -04:00
parent 5b37536ce5
commit 6c6f6838ee
No known key found for this signature in database
GPG Key ID: 7E303019E6BB02D7
1 changed files with 3 additions and 7 deletions

View File

@ -250,7 +250,7 @@ const drawNote = function(elem, noteModel) {
const drawMessage = function(g, msgModel) {
const { startx, stopx, starty, message, type, sequenceIndex, wrap } = msgModel;
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;
msgModel.height += lineHeight;
@ -968,17 +968,13 @@ const buildMessageModel = function(msg, actors) {
if (msg.wrap && msg.message && !common.lineBreakRegex.test(msg.message)) {
msg.message = utils.wrapLabel(
msg.message,
Math.max(
msgDims.width + 2 * conf.wrapPadding,
boundedWidth + 2 * conf.wrapPadding,
conf.width
),
Math.max(boundedWidth + 2 * conf.wrapPadding, conf.width),
conf.messageFont()
);
}
return {
width: Math.max(
msgDims.width + 2 * conf.wrapPadding,
msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding,
boundedWidth + 2 * conf.wrapPadding,
conf.width
),