Fix for class title label css

This commit is contained in:
Ashish Jain
2020-08-27 20:43:37 +02:00
parent 7164eaa8b1
commit b244118fd9
4 changed files with 8 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ describe('State diagram', () => {
);
cy.get('svg');
});
it('v2 should render a transition descrions with new lines', () => {
it('v2 should render a transition descriptions with new lines', () => {
imgSnapshotTest(
`
stateDiagram-v2

View File

@@ -39,7 +39,7 @@ export const insertEdgeLabel = (elem, edge) => {
edgeLabels[edge.id] = edgeLabel;
// Update the abstract data of the edge with the new information about its width and height
edge.width = bbox.width;
edge.width = bbox.width + 40;
edge.height = bbox.height;
if (edge.startLabelLeft) {

View File

@@ -596,6 +596,7 @@ const class_box = (parent, node) => {
const classTitleLabel = labelContainer
.node()
.appendChild(createLabel(classTitleString, node.labelStyle, true, true));
select(classTitleLabel).attr('class', 'classTitle');
let classTitleBBox = classTitleLabel.getBBox();
if (getConfig().flowchart.htmlLabels) {
const div = classTitleLabel.children[0];

View File

@@ -6,9 +6,11 @@ const getStyles = options =>
font-family: ${options.fontFamily};
font-size: 10px;
.title {
font-weight: bolder;
}
.classTitle {
font-weight: bolder;
}
.node rect,
.node circle,