mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-04 16:16:41 +02:00
updated tiltedCylinder shape
This commit is contained in:
@@ -24,7 +24,7 @@ function createInnerPathD(rx: number, ry: number, w: number, h: number) {
|
|||||||
export const tiltedCylinder = async (parent: SVGAElement, node: Node) => {
|
export const tiltedCylinder = async (parent: SVGAElement, node: Node) => {
|
||||||
const { labelStyles, nodeStyles } = styles2String(node);
|
const { labelStyles, nodeStyles } = styles2String(node);
|
||||||
node.labelStyle = labelStyles;
|
node.labelStyle = labelStyles;
|
||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
const h = bbox.height + node.padding;
|
const h = bbox.height + node.padding;
|
||||||
const ry = h / 2;
|
const ry = h / 2;
|
||||||
const rx = ry / (2.5 + h / 50);
|
const rx = ry / (2.5 + h / 50);
|
||||||
@@ -59,6 +59,11 @@ export const tiltedCylinder = async (parent: SVGAElement, node: Node) => {
|
|||||||
tiltedCylinder.selectAll('path').attr('style', nodeStyles);
|
tiltedCylinder.selectAll('path').attr('style', nodeStyles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label.attr(
|
||||||
|
'transform',
|
||||||
|
`translate(${-(bbox.width / 2) - rx - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`
|
||||||
|
);
|
||||||
|
|
||||||
updateNodeBounds(node, tiltedCylinder);
|
updateNodeBounds(node, tiltedCylinder);
|
||||||
|
|
||||||
node.intersect = function (point) {
|
node.intersect = function (point) {
|
||||||
|
Reference in New Issue
Block a user