Restore fill pointer events for all shapes

This commit is contained in:
Steve Ruiz 2021-07-12 12:48:07 +01:00
parent 6b3bd2ac04
commit 08c5166b61
2 changed files with 22 additions and 27 deletions

View file

@ -59,17 +59,15 @@ const ellipse = registerShapeUtils<EllipseShape>({
return ( return (
<> <>
{style.isFilled && (
<ellipse <ellipse
cx={radiusX} cx={radiusX}
cy={radiusY} cy={radiusY}
rx={rx} rx={rx}
ry={ry} ry={ry}
stroke="none" stroke="none"
fill={styles.fill} fill={style.isFilled ? styles.fill : 'transparent'}
pointerEvents="fill" pointerEvents="all"
/> />
)}
<path <path
d={path} d={path}
fill={styles.stroke} fill={styles.stroke}
@ -106,7 +104,7 @@ const ellipse = registerShapeUtils<EllipseShape>({
strokeWidth={sw} strokeWidth={sw}
strokeDasharray={strokeDasharray} strokeDasharray={strokeDasharray}
strokeDashoffset={strokeDashoffset} strokeDashoffset={strokeDashoffset}
pointerEvents={style.isFilled ? 'all' : 'stroke'} pointerEvents="all"
/> />
) )
}, },

View file

@ -40,7 +40,6 @@ const rectangle = registerShapeUtils<RectangleShape>({
return ( return (
<> <>
{style.isFilled && (
<rect <rect
rx={radius} rx={radius}
ry={radius} ry={radius}
@ -48,18 +47,16 @@ const rectangle = registerShapeUtils<RectangleShape>({
y={+styles.strokeWidth / 2} y={+styles.strokeWidth / 2}
width={Math.max(0, size[0] - strokeWidth)} width={Math.max(0, size[0] - strokeWidth)}
height={Math.max(0, size[1] - strokeWidth)} height={Math.max(0, size[1] - strokeWidth)}
strokeWidth={0} fill={style.isFilled ? styles.fill : 'transparent'}
fill={styles.fill} stroke="none"
stroke={styles.stroke}
/> />
)}
<path <path
d={pathData} d={pathData}
fill={styles.stroke} fill={styles.stroke}
stroke={styles.stroke} stroke={styles.stroke}
strokeWidth={styles.strokeWidth} strokeWidth={styles.strokeWidth}
filter={isHovered ? 'url(#expand)' : 'none'} filter={isHovered ? 'url(#expand)' : 'none'}
pointerEvents={style.isFilled ? 'all' : 'stroke'} pointerEvents="all"
/> />
</> </>
) )
@ -110,7 +107,7 @@ const rectangle = registerShapeUtils<RectangleShape>({
fill={styles.fill} fill={styles.fill}
stroke="transparent" stroke="transparent"
strokeWidth={sw} strokeWidth={sw}
pointerEvents={style.isFilled ? 'all' : 'stroke'} pointerEvents="all"
/> />
<g filter={isHovered ? 'url(#expand)' : 'none'} pointerEvents="stroke"> <g filter={isHovered ? 'url(#expand)' : 'none'} pointerEvents="stroke">
{paths} {paths}