#958 Cannot center-justify text in nodes

- assign text-align style to text node to allow aligning of node text
This commit is contained in:
Kolja Markwardt
2019-10-14 22:10:58 +02:00
parent 74c171b6d1
commit 90fe015d68
2 changed files with 41 additions and 1 deletions

View File

@@ -36,9 +36,10 @@ export const addVertices = function(vert, g, svgId) {
}
}
} else {
// create the style definition for the text, if property is a text-property
for (let i = 0; i < arr.length; i++) {
if (typeof arr[i] !== 'undefined') {
if (arr[i].match('^color:')) styleStr = styleStr + arr[i] + ';';
if (arr[i].match('^color:|^text-align:')) styleStr = styleStr + arr[i] + ';';
}
}
}