mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
#5237 Fix for rough styling of regular states and dividers in state diagrams
This commit is contained in:
@@ -321,16 +321,13 @@ const divider = (parent, node) => {
|
|||||||
let rect;
|
let rect;
|
||||||
if (node.look === 'handdrawn') {
|
if (node.look === 'handdrawn') {
|
||||||
const rc = rough.svg(shapeSvg);
|
const rc = rough.svg(shapeSvg);
|
||||||
const roughOuterNode =
|
const roughOuterNode = rc.rectangle(x, y, width, height, {
|
||||||
node.rx || node.ry
|
fill: 'lightgrey',
|
||||||
? rc.path(createRoundedRectPathD(x, y, width, height, 10), {
|
roughness: 0.5,
|
||||||
roughness: 0.7,
|
strokeLineDash: [5],
|
||||||
fill: compositeTitleBackground,
|
stroke: nodeBorder,
|
||||||
fillStyle: 'solid',
|
seed: handdrawnSeed,
|
||||||
stroke: nodeBorder,
|
});
|
||||||
seed: handdrawnSeed,
|
|
||||||
})
|
|
||||||
: rc.rectangle(x, y, width, height, { seed: handdrawnSeed });
|
|
||||||
|
|
||||||
rect = shapeSvg.insert(() => roughOuterNode, ':first-child');
|
rect = shapeSvg.insert(() => roughOuterNode, ':first-child');
|
||||||
} else {
|
} else {
|
||||||
|
@@ -24,7 +24,6 @@ export const drawRect = async (parent: SVGAElement, node: Node, options: RectOpt
|
|||||||
// log.info('IPI node = ', node);
|
// log.info('IPI node = ', node);
|
||||||
|
|
||||||
let rect;
|
let rect;
|
||||||
node.look = look;
|
|
||||||
let { rx, ry } = node;
|
let { rx, ry } = node;
|
||||||
const { cssStyles } = node;
|
const { cssStyles } = node;
|
||||||
|
|
||||||
|
@@ -82,7 +82,7 @@ export const userNodeOverrides = (node: Node, options: any) => {
|
|||||||
roughness: 0.7,
|
roughness: 0.7,
|
||||||
fill: stylesMap.get('fill') || mainBkg,
|
fill: stylesMap.get('fill') || mainBkg,
|
||||||
fillStyle: 'hachure', // solid fill
|
fillStyle: 'hachure', // solid fill
|
||||||
fillWeight: 3.5,
|
fillWeight: 4,
|
||||||
stroke: stylesMap.get('stroke') || nodeBorder,
|
stroke: stylesMap.get('stroke') || nodeBorder,
|
||||||
seed: handdrawnSeed,
|
seed: handdrawnSeed,
|
||||||
strokeWidth: 1.3,
|
strokeWidth: 1.3,
|
||||||
|
21088
pnpm-lock.yaml
generated
21088
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user