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

View file

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