fixed hover highlight for crossed circle multiRect and multiWavedEgeRect

This commit is contained in:
saurabhg772244
2024-09-24 14:18:51 +05:30
parent 5a1640ee34
commit 3a3ea06413
3 changed files with 8 additions and 5 deletions

View File

@@ -42,7 +42,8 @@ export const crossedCircle = (parent: SVG, node: Node) => {
const linePath = createLine(radius);
const lineNode = rc.path(linePath, options);
const crossedCircle = shapeSvg.insert(() => circleNode, ':first-child');
const crossedCircle = shapeSvg.insert('g', ':first-child');
crossedCircle.insert(() => circleNode);
crossedCircle.insert(() => lineNode);
if (cssStyles && node.look !== 'handDrawn') {

View File

@@ -13,7 +13,7 @@ export const multiRect = async (parent: SVGAElement, node: Node) => {
const labelPaddingY = node.look === 'neo' ? nodePadding * 1 : nodePadding;
const w = Math.max(bbox.width + (labelPaddingX ?? 0) * 2, node?.width ?? 0);
const h = Math.max(bbox.height + (labelPaddingY ?? 0) * 2, node?.height ?? 0);
const rectOffset = 5;
const rectOffset = node.look === 'neo' ? 10 : 5;
const x = -w / 2;
const y = -h / 2;
const { cssStyles } = node;
@@ -54,9 +54,10 @@ export const multiRect = async (parent: SVGAElement, node: Node) => {
const outerPath = createPathFromPoints(outerPathPoints);
const outerNode = rc.path(outerPath, options);
const innerPath = createPathFromPoints(innerPathPoints);
const innerNode = rc.path(innerPath, { ...options, fill: 'none' });
const innerNode = rc.path(innerPath, options);
const multiRect = shapeSvg.insert(() => outerNode, ':first-child');
const multiRect = shapeSvg.insert('g', ':first-child');
multiRect.insert(() => outerNode);
multiRect.insert(() => innerNode);
multiRect.attr('class', 'basic label-container');

View File

@@ -77,7 +77,8 @@ export const multiWaveEdgedRectangle = async (parent: SVGAElement, node: Node) =
const innerPath = createPathFromPoints(innerPathPoints);
const innerNode = rc.path(innerPath, options);
const shape = shapeSvg.insert(() => outerNode, ':first-child');
const shape = shapeSvg.insert('g', ':first-child');
shape.insert(() => outerNode);
shape.insert(() => innerNode);
shape.attr('class', 'basic label-container');