Fixes for rendering tests

This commit is contained in:
Knut Sveidqvist
2022-07-20 14:39:01 +02:00
parent 27cf50044d
commit 8681e78e50
10 changed files with 81 additions and 54 deletions

View File

@@ -847,9 +847,12 @@ const _drawTextCandidateFunc = (function () {
function byTspan(content, g, x, y, width, height, textAttrs, conf) {
const { actorFontSize, actorFontFamily, actorFontWeight } = conf;
let _actorFontSize =
actorFontSize && actorFontSize.replace ? actorFontSize.replace('px', '') : actorFontSize;
const lines = content.split(common.lineBreakRegex);
for (let i = 0; i < lines.length; i++) {
const dy = i * actorFontSize - (actorFontSize * (lines.length - 1)) / 2;
const dy = i * _actorFontSize - (_actorFontSize * (lines.length - 1)) / 2;
const text = g
.append('text')
.attr('x', x + width / 2)