|
|
@@ -40,7 +40,6 @@ const draw = registerShapeUtils<DrawShape>({
|
|
40
|
40
|
style: {
|
|
41
|
41
|
...defaultStyle,
|
|
42
|
42
|
...props.style,
|
|
43
|
|
- isFilled: false,
|
|
44
|
43
|
},
|
|
45
|
44
|
}
|
|
46
|
45
|
},
|
|
|
@@ -60,7 +59,20 @@ const draw = registerShapeUtils<DrawShape>({
|
|
60
|
59
|
)
|
|
61
|
60
|
}
|
|
62
|
61
|
|
|
63
|
|
- return <path id={id} d={pathCache.get(points)} fill={styles.stroke} />
|
|
|
62
|
+ return (
|
|
|
63
|
+ <g id={id}>
|
|
|
64
|
+ {points.length > 3 &&
|
|
|
65
|
+ vec.dist(points[0], points[points.length - 1]) < 8 && (
|
|
|
66
|
+ <polyline
|
|
|
67
|
+ points={points.map((pt) => pt.slice(0, 2)).join(',')}
|
|
|
68
|
+ fill={styles.fill}
|
|
|
69
|
+ stroke="none"
|
|
|
70
|
+ strokeWidth={0}
|
|
|
71
|
+ />
|
|
|
72
|
+ )}
|
|
|
73
|
+ <path d={pathCache.get(points)} fill={styles.stroke} />
|
|
|
74
|
+ </g>
|
|
|
75
|
+ )
|
|
64
|
76
|
},
|
|
65
|
77
|
|
|
66
|
78
|
getBounds(shape) {
|
|
|
@@ -151,7 +163,6 @@ const draw = registerShapeUtils<DrawShape>({
|
|
151
|
163
|
|
|
152
|
164
|
applyStyles(shape, style) {
|
|
153
|
165
|
const styles = { ...shape.style, ...style }
|
|
154
|
|
- styles.isFilled = false
|
|
155
|
166
|
styles.dash = DashStyle.Solid
|
|
156
|
167
|
shape.style = styles
|
|
157
|
168
|
shape.points = [...shape.points]
|
|
|
@@ -170,7 +181,7 @@ const draw = registerShapeUtils<DrawShape>({
|
|
170
|
181
|
return this
|
|
171
|
182
|
},
|
|
172
|
183
|
|
|
173
|
|
- canStyleFill: false,
|
|
|
184
|
+ canStyleFill: true,
|
|
174
|
185
|
})
|
|
175
|
186
|
|
|
176
|
187
|
export default draw
|