Skip to content

Commit

Permalink
adding fill property in font-style
Browse files Browse the repository at this point in the history
  • Loading branch information
chinnamatli kusumalatha authored and chinnamatli kusumalatha committed Dec 17, 2024
1 parent 8c71b02 commit 10e2fe3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/dmn-editor/src/diagram/nodes/NodeStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface DmnFontStyle {
family?: string;
size?: number;
color: string;
fill: string;
}

export interface Color {
Expand Down Expand Up @@ -169,6 +170,7 @@ export function getDmnFontStyle(args: {
family: args.isEnabled ? args.dmnStyle?.["@_fontFamily"] : undefined,
size: args.isEnabled ? args.dmnStyle?.["@_fontSize"] : undefined,
color: fontColor,
fill: fontColor,
};
}

Expand All @@ -189,6 +191,7 @@ export function getFontCssProperties(dmnFontStyle?: DmnFontStyle): React.CSSProp
textDecoration,
fontSize: dmnFontStyle?.size ?? "16px",
color: dmnFontStyle?.color ?? "black",
fill: dmnFontStyle?.fill ?? "black",
lineHeight: "1.5em", // This needs to be em `em` otherwise `@visx/text` breaks when generating the SVG.
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dmn-editor/src/svg/DmnDiagramSvg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export function DmnDiagramSvg({
<Text
key={i}
lineHeight={fontStyle.lineHeight}
style={{ ...fontStyle, fill: fontStyle.color }}
style={{ ...fontStyle }}
dy={`calc(1.5em * ${i})`}
{...getNodeLabelSvgTextAlignmentProps(
node,
Expand Down

0 comments on commit 10e2fe3

Please sign in to comment.