fix selection for filled shapes
This commit is contained in:
parent
eb234330dd
commit
45c0febdad
3 changed files with 16 additions and 18 deletions
|
@ -112,13 +112,13 @@ export class EllipseUtil extends TDShapeUtil<T, E> {
|
||||||
className="tl-binding-indicator"
|
className="tl-binding-indicator"
|
||||||
cx={radiusX}
|
cx={radiusX}
|
||||||
cy={radiusY}
|
cy={radiusY}
|
||||||
rx={rx}
|
rx={radiusX}
|
||||||
ry={ry}
|
ry={radiusY}
|
||||||
strokeWidth={this.bindingDistance}
|
strokeWidth={this.bindingDistance}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<ellipse
|
<ellipse
|
||||||
className={isSelected ? 'tl-fill-hitarea' : 'tl-stroke-hitarea'}
|
className={style.isFilled || isSelected ? 'tl-fill-hitarea' : 'tl-stroke-hitarea'}
|
||||||
cx={radiusX}
|
cx={radiusX}
|
||||||
cy={radiusY}
|
cy={radiusY}
|
||||||
rx={radiusX}
|
rx={radiusX}
|
||||||
|
@ -127,8 +127,8 @@ export class EllipseUtil extends TDShapeUtil<T, E> {
|
||||||
<ellipse
|
<ellipse
|
||||||
cx={radiusX}
|
cx={radiusX}
|
||||||
cy={radiusY}
|
cy={radiusY}
|
||||||
rx={radiusX}
|
rx={rx}
|
||||||
ry={radiusY}
|
ry={ry}
|
||||||
fill={styles.fill}
|
fill={styles.fill}
|
||||||
stroke={styles.stroke}
|
stroke={styles.stroke}
|
||||||
strokeWidth={sw}
|
strokeWidth={sw}
|
||||||
|
|
|
@ -123,18 +123,19 @@ export class RectangleUtil extends TDShapeUtil<T, E> {
|
||||||
{isBinding && (
|
{isBinding && (
|
||||||
<rect
|
<rect
|
||||||
className="tl-binding-indicator"
|
className="tl-binding-indicator"
|
||||||
x={sw / 2 - 32}
|
x={0}
|
||||||
y={sw / 2 - 32}
|
y={0}
|
||||||
width={w + 64}
|
width={size[0]}
|
||||||
height={h + 64}
|
height={size[1]}
|
||||||
|
strokeWidth={this.bindingDistance}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<rect
|
<rect
|
||||||
className="tl-binding-indicator"
|
className={isSelected || style.isFilled ? 'tl-fill-hitarea' : 'tl-stroke-hitarea'}
|
||||||
x={sw / 2 - 32}
|
x={sw / 2}
|
||||||
y={sw / 2 - 32}
|
y={sw / 2}
|
||||||
width={w + 64}
|
width={w}
|
||||||
height={h + 64}
|
height={h}
|
||||||
strokeWidth={this.bindingDistance}
|
strokeWidth={this.bindingDistance}
|
||||||
/>
|
/>
|
||||||
{style.isFilled && (
|
{style.isFilled && (
|
||||||
|
|
|
@ -125,11 +125,8 @@ export class TriangleUtil extends TDShapeUtil<T, E> {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<polygon
|
<polygon
|
||||||
|
className={style.isFilled || isSelected ? 'tl-fill-hitarea' : 'tl-stroke-hitarea'}
|
||||||
points={points.join()}
|
points={points.join()}
|
||||||
fill={styles.fill}
|
|
||||||
strokeWidth={sw}
|
|
||||||
stroke="none"
|
|
||||||
pointerEvents="all"
|
|
||||||
/>
|
/>
|
||||||
<g pointerEvents="stroke">{paths}</g>
|
<g pointerEvents="stroke">{paths}</g>
|
||||||
</SVGContainer>
|
</SVGContainer>
|
||||||
|
|
Loading…
Reference in a new issue