@checksub_team/peaks_timeline 1.4.34 → 1.4.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,354 +1,354 @@
1
- /**
2
- * @file
3
- *
4
- * Defines the {@link SegmentShape} class.
5
- *
6
- * @module segment-shape
7
- */
8
-
9
- define([
10
- 'konva',
11
- './segment-marker'
12
- ], function(
13
- Konva,
14
- SegmentMarker) {
15
- 'use strict';
16
-
17
- var SEGMENT_WIDTH = 10;
18
-
19
- /**
20
- * Creates a waveform segment shape with optional start and end markers.
21
- *
22
- * @class
23
- * @alias SegmentShape
24
- *
25
- * @param {Segment} segment
26
- * @param {Peaks} peaks
27
- * @param {SegmentsGroup} group
28
- * @param {WaveformOverview|WaveformZoomView} view
29
- */
30
-
31
- function SegmentShape(segment, peaks, group, view) {
32
- this._segment = segment;
33
- this._peaks = peaks;
34
- this._group = group;
35
- this._view = view;
36
- // this._waveformShape = null;
37
- this._segmentsGroup = null;
38
- this._label = null;
39
- this._startMarker = null;
40
- this._endMarker = null;
41
- this._rectangle = null;
42
- this._isSelected = false;
43
-
44
- this._segmentHeight = this._peaks.options.segmentHeight;
45
-
46
- this._rectangle = new Konva.Rect({
47
- x: this._view.timeToPixels(this._segment.startTime),
48
- y: 0,
49
- width: this._view.timeToPixels(this._segment.endTime - this._segment.startTime),
50
- height: this._segmentHeight,
51
- cornerRadius: 10,
52
- fill: segment.color + Math.round(segment.opacity * 255).toString(16),
53
- stroke: segment.textColor + 'FF',
54
- strokeWidth: 1,
55
- draggable: this._segment.editable
56
- });
57
-
58
- var self = this;
59
-
60
- this._rectangle.dragBoundFunc(function() {
61
- var diff = self._view.getPointerPosition().x - self._mouseDownX;
62
-
63
- self._group.updateSegment(
64
- self._segment,
65
- self._initialStartPixel + diff, self._initialEndPixel + diff
66
- );
67
-
68
- self._startMarker.timeUpdated(self._segment.startTime);
69
- self._endMarker.timeUpdated(self._segment.endTime);
70
-
71
- return {
72
- x: this.absolutePosition().x,
73
- y: this.absolutePosition().y
74
- };
75
- });
76
-
77
- // Set up event handlers to show/hide the segment label text when the user
78
- // hovers the mouse over the segment.
79
- this._rectangle.on('mouseenter', this._onMouseEnter.bind(this));
80
- this._rectangle.on('mouseleave', this._onMouseLeave.bind(this));
81
- this._rectangle.on('click', this._onClick.bind(this));
82
-
83
- this._rectangle.on('dragstart', this._onSegmentDragStart.bind(this));
84
- this._rectangle.on('dragend', this._onSegmentDragEnd.bind(this));
85
-
86
- // Event handlers for markers
87
- this._onSegmentHandleDrag = this._onSegmentHandleDrag.bind(this);
88
- this._onSegmentHandleDragStart = this._onSegmentHandleDragStart.bind(this);
89
- this._onSegmentHandleDragEnd = this._onSegmentHandleDragEnd.bind(this);
90
-
91
- this._label = this._peaks.options.createSegmentLabel({
92
- x: this._view.timeToPixels(segment.startTime),
93
- y: this._segmentY,
94
- width: this._view.timeToPixels(this._segment.endTime - this._segment.startTime),
95
- height: this._segmentHeight,
96
- segment: segment,
97
- view: this._view.getName(),
98
- group: this._group,
99
- fontSize: 12
100
- });
101
-
102
- this._createMarkers();
103
- }
104
-
105
- SegmentShape.prototype.update = function() {
106
- var startPixel = this._view.timeToPixels(this._segment.startTime);
107
- var endPixel = this._view.timeToPixels(this._segment.endTime);
108
- var frameOffset = this._view.timeToPixels(this._view.getTimeOffset());
109
-
110
- this._rectangle.x(startPixel - frameOffset);
111
-
112
- this._rectangle.width(endPixel - startPixel);
113
-
114
- var newWidth = Math.floor(this._rectangle.width() / 2);
115
-
116
- if (this._rectangle.width()
117
- < this._startMarker.getHandleWidth() + this._endMarker.getHandleWidth()) {
118
- this._startMarker.setHandleWidth(newWidth);
119
- this._endMarker.setHandleWidth(newWidth);
120
- }
121
- else if (this._startMarker.getHandleWidth() < SEGMENT_WIDTH
122
- && newWidth > this._startMarker.getHandleWidth()) {
123
- this._startMarker.setHandleWidth(Math.min(newWidth, SEGMENT_WIDTH));
124
- this._endMarker.setHandleWidth(Math.min(newWidth, SEGMENT_WIDTH));
125
- }
126
-
127
- if (this._startMarker) {
128
- this._startMarker.setX(startPixel - frameOffset);
129
- this._startMarker.timeUpdated(this._segment.startTime);
130
- }
131
-
132
- if (this._endMarker) {
133
- this._endMarker.setX(endPixel - this._endMarker.getHandleWidth() - frameOffset);
134
- this._endMarker.timeUpdated(this._segment.endTime);
135
- }
136
-
137
- if (this._label) {
138
- this._label.setX(startPixel - frameOffset);
139
- this._label.setWidth(endPixel - startPixel);
140
- }
141
- };
142
-
143
- SegmentShape.prototype.getSegmentHeight = function() {
144
- return this._segmentHeight;
145
- };
146
-
147
- SegmentShape.prototype.getText = function() {
148
- return this._label;
149
- };
150
-
151
- SegmentShape.prototype.getSegment = function() {
152
- return this._segment;
153
- };
154
-
155
- SegmentShape.prototype.getSegmentsGroup = function() {
156
- return this._segmentsGroup;
157
- };
158
-
159
- SegmentShape.prototype.getStartMarker = function() {
160
- return this._startMarker;
161
- };
162
-
163
- SegmentShape.prototype.getEndMarker = function() {
164
- return this._endMarker;
165
- };
166
-
167
- SegmentShape.prototype.addToGroup = function(group, segmentsGroup) {
168
- if (segmentsGroup) {
169
- this._segmentsGroup = segmentsGroup;
170
- }
171
-
172
- group.add(this._rectangle);
173
-
174
- if (this._label) {
175
- group.add(this._label);
176
- }
177
-
178
- if (this._startMarker) {
179
- this._startMarker.addToGroup(group);
180
- }
181
-
182
- if (this._endMarker) {
183
- this._endMarker.addToGroup(group);
184
- }
185
- };
186
-
187
- SegmentShape.prototype._createMarkers = function() {
188
- var editable = this._group.isEditingEnabled() && this._segment.editable;
189
-
190
- var startMarker = this._peaks.options.createSegmentMarker({
191
- peaks: this._peaks,
192
- segment: this._segment,
193
- draggable: editable,
194
- startMarker: true,
195
- group: this._group,
196
- view: this._view,
197
- showSegmentMarkers: this._peaks.options.showSegmentMarkers,
198
- segmentHeight: this._segmentHeight,
199
- segmentWidth: SEGMENT_WIDTH,
200
- y: this._segmentY
201
- });
202
-
203
- if (startMarker) {
204
- this._startMarker = new SegmentMarker({
205
- segment: this._segment,
206
- segmentShape: this,
207
- draggable: editable,
208
- startMarker: true,
209
- marker: startMarker,
210
- onDrag: this._onSegmentHandleDrag,
211
- onDragStart: this._onSegmentHandleDragStart,
212
- onDragEnd: this._onSegmentHandleDragEnd,
213
- view: this._view
214
- });
215
- }
216
-
217
- var endMarker = this._peaks.options.createSegmentMarker({
218
- peaks: this._peaks,
219
- segment: this._segment,
220
- draggable: editable,
221
- startMarker: false,
222
- group: this._group,
223
- view: this._view,
224
- showSegmentMarkers: this._peaks.options.showSegmentMarkers,
225
- segmentHeight: this._segmentHeight,
226
- segmentWidth: SEGMENT_WIDTH,
227
- y: this._segmentY
228
- });
229
-
230
- if (endMarker) {
231
- this._endMarker = new SegmentMarker({
232
- segment: this._segment,
233
- segmentShape: this,
234
- draggable: editable,
235
- startMarker: false,
236
- marker: endMarker,
237
- onDrag: this._onSegmentHandleDrag,
238
- onDragStart: this._onSegmentHandleDragStart,
239
- onDragEnd: this._onSegmentHandleDragEnd,
240
- view: this._view
241
- });
242
- }
243
- };
244
-
245
- SegmentShape.prototype._onMouseEnter = function() {
246
- this._view.setCursor('pointer');
247
-
248
- this._view.setHoveredElement(this);
249
-
250
- this._rectangle.fill(this._segment.hoverColor + Math.round(
251
- this._segment.opacity * 255
252
- ).toString(16));
253
-
254
- this._view.drawSourcesLayer();
255
-
256
- this._peaks.emit('segments.mouseenter', this._segment);
257
- };
258
-
259
- SegmentShape.prototype._onMouseLeave = function() {
260
- this._view.setCursor('default');
261
-
262
- this._view.setHoveredElement(null);
263
-
264
- this._rectangle.fill(this._segment.color + Math.round(
265
- this._segment.opacity * 255
266
- ).toString(16));
267
-
268
- this._view.drawSourcesLayer();
269
-
270
- this._peaks.emit('segments.mouseleave', this._segment);
271
- };
272
-
273
- SegmentShape.prototype._onClick = function() {
274
- this._peaks.emit('segments.click', this._segment);
275
- };
276
-
277
- SegmentShape.prototype._onSegmentDragStart = function() {
278
- this._view.setCursor('grab');
279
-
280
- this._mouseDownX = this._view.getPointerPosition().x;
281
- this._initialStartTime = this._segment.startTime;
282
- this._initialStartPixel = this._view.timeToPixels(this._initialStartTime);
283
- this._initialEndTime = this._segment.endTime;
284
- this._initialEndPixel = this._view.timeToPixels(this._initialEndTime);
285
-
286
- this._peaks.emit('segments.dragstart', this._segment);
287
- };
288
-
289
- SegmentShape.prototype._onSegmentDragEnd = function() {
290
- this._view.setCursor('pointer');
291
-
292
- this._peaks.emit('segments.dragend', this._segment);
293
- };
294
-
295
- /**
296
- * @param {SegmentMarker} segmentMarker
297
- */
298
-
299
- SegmentShape.prototype._onSegmentHandleDrag = function() {
300
- this._peaks.emit('segments.dragged');
301
- };
302
-
303
- /**
304
- * @param {SegmentMarker} segmentMarker
305
- */
306
-
307
- SegmentShape.prototype._onSegmentHandleDragStart = function(segmentMarker) {
308
- var startMarker = segmentMarker.isStartMarker();
309
-
310
- this._peaks.emit('segments.dragstart', this._segment, startMarker);
311
- };
312
-
313
- /**
314
- * @param {SegmentMarker} segmentMarker
315
- */
316
-
317
- SegmentShape.prototype._onSegmentHandleDragEnd = function(segmentMarker) {
318
- var startMarker = segmentMarker.isStartMarker();
319
-
320
- this._peaks.emit('segments.dragend', this._segment, startMarker);
321
- };
322
-
323
- SegmentShape.prototype.setSelected = function(isSelected) {
324
- this._isSelected = isSelected;
325
- };
326
-
327
- SegmentShape.prototype.fitToView = function() {
328
- if (this._startMarker) {
329
- this._startMarker.fitToView();
330
- }
331
-
332
- if (this._endMarker) {
333
- this._endMarker.fitToView();
334
- }
335
- };
336
-
337
- SegmentShape.prototype.destroy = function() {
338
- this._rectangle.destroy();
339
-
340
- if (this._label) {
341
- this._label.destroy();
342
- }
343
-
344
- if (this._startMarker) {
345
- this._startMarker.destroy();
346
- }
347
-
348
- if (this._endMarker) {
349
- this._endMarker.destroy();
350
- }
351
- };
352
-
353
- return SegmentShape;
354
- });
1
+ /**
2
+ * @file
3
+ *
4
+ * Defines the {@link SegmentShape} class.
5
+ *
6
+ * @module segment-shape
7
+ */
8
+
9
+ define([
10
+ 'konva',
11
+ './segment-marker'
12
+ ], function(
13
+ Konva,
14
+ SegmentMarker) {
15
+ 'use strict';
16
+
17
+ var SEGMENT_WIDTH = 10;
18
+
19
+ /**
20
+ * Creates a waveform segment shape with optional start and end markers.
21
+ *
22
+ * @class
23
+ * @alias SegmentShape
24
+ *
25
+ * @param {Segment} segment
26
+ * @param {Peaks} peaks
27
+ * @param {SegmentsGroup} group
28
+ * @param {WaveformOverview|WaveformZoomView} view
29
+ */
30
+
31
+ function SegmentShape(segment, peaks, group, view) {
32
+ this._segment = segment;
33
+ this._peaks = peaks;
34
+ this._group = group;
35
+ this._view = view;
36
+ // this._waveformShape = null;
37
+ this._segmentsGroup = null;
38
+ this._label = null;
39
+ this._startMarker = null;
40
+ this._endMarker = null;
41
+ this._rectangle = null;
42
+ this._isSelected = false;
43
+
44
+ this._segmentHeight = this._peaks.options.segmentHeight;
45
+
46
+ this._rectangle = new Konva.Rect({
47
+ x: this._view.timeToPixels(this._segment.startTime),
48
+ y: 0,
49
+ width: this._view.timeToPixels(this._segment.endTime - this._segment.startTime),
50
+ height: this._segmentHeight,
51
+ cornerRadius: 10,
52
+ fill: segment.color + Math.round(segment.opacity * 255).toString(16),
53
+ stroke: segment.textColor + 'FF',
54
+ strokeWidth: 1,
55
+ draggable: this._segment.editable
56
+ });
57
+
58
+ var self = this;
59
+
60
+ this._rectangle.dragBoundFunc(function() {
61
+ var diff = self._view.getPointerPosition().x - self._mouseDownX;
62
+
63
+ self._group.updateSegment(
64
+ self._segment,
65
+ self._initialStartPixel + diff, self._initialEndPixel + diff
66
+ );
67
+
68
+ self._startMarker.timeUpdated(self._segment.startTime);
69
+ self._endMarker.timeUpdated(self._segment.endTime);
70
+
71
+ return {
72
+ x: this.absolutePosition().x,
73
+ y: this.absolutePosition().y
74
+ };
75
+ });
76
+
77
+ // Set up event handlers to show/hide the segment label text when the user
78
+ // hovers the mouse over the segment.
79
+ this._rectangle.on('mouseenter', this._onMouseEnter.bind(this));
80
+ this._rectangle.on('mouseleave', this._onMouseLeave.bind(this));
81
+ this._rectangle.on('click', this._onClick.bind(this));
82
+
83
+ this._rectangle.on('dragstart', this._onSegmentDragStart.bind(this));
84
+ this._rectangle.on('dragend', this._onSegmentDragEnd.bind(this));
85
+
86
+ // Event handlers for markers
87
+ this._onSegmentHandleDrag = this._onSegmentHandleDrag.bind(this);
88
+ this._onSegmentHandleDragStart = this._onSegmentHandleDragStart.bind(this);
89
+ this._onSegmentHandleDragEnd = this._onSegmentHandleDragEnd.bind(this);
90
+
91
+ this._label = this._peaks.options.createSegmentLabel({
92
+ x: this._view.timeToPixels(segment.startTime),
93
+ y: this._segmentY,
94
+ width: this._view.timeToPixels(this._segment.endTime - this._segment.startTime),
95
+ height: this._segmentHeight,
96
+ segment: segment,
97
+ view: this._view.getName(),
98
+ group: this._group,
99
+ fontSize: 12
100
+ });
101
+
102
+ this._createMarkers();
103
+ }
104
+
105
+ SegmentShape.prototype.update = function() {
106
+ var startPixel = this._view.timeToPixels(this._segment.startTime);
107
+ var endPixel = this._view.timeToPixels(this._segment.endTime);
108
+ var frameOffset = this._view.timeToPixels(this._view.getTimeOffset());
109
+
110
+ this._rectangle.x(startPixel - frameOffset);
111
+
112
+ this._rectangle.width(endPixel - startPixel);
113
+
114
+ var newWidth = Math.floor(this._rectangle.width() / 2);
115
+
116
+ if (this._rectangle.width()
117
+ < this._startMarker.getHandleWidth() + this._endMarker.getHandleWidth()) {
118
+ this._startMarker.setHandleWidth(newWidth);
119
+ this._endMarker.setHandleWidth(newWidth);
120
+ }
121
+ else if (this._startMarker.getHandleWidth() < SEGMENT_WIDTH
122
+ && newWidth > this._startMarker.getHandleWidth()) {
123
+ this._startMarker.setHandleWidth(Math.min(newWidth, SEGMENT_WIDTH));
124
+ this._endMarker.setHandleWidth(Math.min(newWidth, SEGMENT_WIDTH));
125
+ }
126
+
127
+ if (this._startMarker) {
128
+ this._startMarker.setX(startPixel - frameOffset);
129
+ this._startMarker.timeUpdated(this._segment.startTime);
130
+ }
131
+
132
+ if (this._endMarker) {
133
+ this._endMarker.setX(endPixel - this._endMarker.getHandleWidth() - frameOffset);
134
+ this._endMarker.timeUpdated(this._segment.endTime);
135
+ }
136
+
137
+ if (this._label) {
138
+ this._label.setX(startPixel - frameOffset);
139
+ this._label.setWidth(endPixel - startPixel);
140
+ }
141
+ };
142
+
143
+ SegmentShape.prototype.getSegmentHeight = function() {
144
+ return this._segmentHeight;
145
+ };
146
+
147
+ SegmentShape.prototype.getText = function() {
148
+ return this._label;
149
+ };
150
+
151
+ SegmentShape.prototype.getSegment = function() {
152
+ return this._segment;
153
+ };
154
+
155
+ SegmentShape.prototype.getSegmentsGroup = function() {
156
+ return this._segmentsGroup;
157
+ };
158
+
159
+ SegmentShape.prototype.getStartMarker = function() {
160
+ return this._startMarker;
161
+ };
162
+
163
+ SegmentShape.prototype.getEndMarker = function() {
164
+ return this._endMarker;
165
+ };
166
+
167
+ SegmentShape.prototype.addToGroup = function(group, segmentsGroup) {
168
+ if (segmentsGroup) {
169
+ this._segmentsGroup = segmentsGroup;
170
+ }
171
+
172
+ group.add(this._rectangle);
173
+
174
+ if (this._label) {
175
+ group.add(this._label);
176
+ }
177
+
178
+ if (this._startMarker) {
179
+ this._startMarker.addToGroup(group);
180
+ }
181
+
182
+ if (this._endMarker) {
183
+ this._endMarker.addToGroup(group);
184
+ }
185
+ };
186
+
187
+ SegmentShape.prototype._createMarkers = function() {
188
+ var editable = this._group.isEditingEnabled() && this._segment.editable;
189
+
190
+ var startMarker = this._peaks.options.createSegmentMarker({
191
+ peaks: this._peaks,
192
+ segment: this._segment,
193
+ draggable: editable,
194
+ startMarker: true,
195
+ group: this._group,
196
+ view: this._view,
197
+ showSegmentMarkers: this._peaks.options.showSegmentMarkers,
198
+ segmentHeight: this._segmentHeight,
199
+ segmentWidth: SEGMENT_WIDTH,
200
+ y: this._segmentY
201
+ });
202
+
203
+ if (startMarker) {
204
+ this._startMarker = new SegmentMarker({
205
+ segment: this._segment,
206
+ segmentShape: this,
207
+ draggable: editable,
208
+ startMarker: true,
209
+ marker: startMarker,
210
+ onDrag: this._onSegmentHandleDrag,
211
+ onDragStart: this._onSegmentHandleDragStart,
212
+ onDragEnd: this._onSegmentHandleDragEnd,
213
+ view: this._view
214
+ });
215
+ }
216
+
217
+ var endMarker = this._peaks.options.createSegmentMarker({
218
+ peaks: this._peaks,
219
+ segment: this._segment,
220
+ draggable: editable,
221
+ startMarker: false,
222
+ group: this._group,
223
+ view: this._view,
224
+ showSegmentMarkers: this._peaks.options.showSegmentMarkers,
225
+ segmentHeight: this._segmentHeight,
226
+ segmentWidth: SEGMENT_WIDTH,
227
+ y: this._segmentY
228
+ });
229
+
230
+ if (endMarker) {
231
+ this._endMarker = new SegmentMarker({
232
+ segment: this._segment,
233
+ segmentShape: this,
234
+ draggable: editable,
235
+ startMarker: false,
236
+ marker: endMarker,
237
+ onDrag: this._onSegmentHandleDrag,
238
+ onDragStart: this._onSegmentHandleDragStart,
239
+ onDragEnd: this._onSegmentHandleDragEnd,
240
+ view: this._view
241
+ });
242
+ }
243
+ };
244
+
245
+ SegmentShape.prototype._onMouseEnter = function() {
246
+ this._view.setCursor('pointer');
247
+
248
+ this._view.setHoveredElement(this);
249
+
250
+ this._rectangle.fill(this._segment.hoverColor + Math.round(
251
+ this._segment.opacity * 255
252
+ ).toString(16));
253
+
254
+ this._view.drawSourcesLayer();
255
+
256
+ this._peaks.emit('segments.mouseenter', this._segment);
257
+ };
258
+
259
+ SegmentShape.prototype._onMouseLeave = function() {
260
+ this._view.setCursor('default');
261
+
262
+ this._view.setHoveredElement(null);
263
+
264
+ this._rectangle.fill(this._segment.color + Math.round(
265
+ this._segment.opacity * 255
266
+ ).toString(16));
267
+
268
+ this._view.drawSourcesLayer();
269
+
270
+ this._peaks.emit('segments.mouseleave', this._segment);
271
+ };
272
+
273
+ SegmentShape.prototype._onClick = function() {
274
+ this._peaks.emit('segments.click', this._segment);
275
+ };
276
+
277
+ SegmentShape.prototype._onSegmentDragStart = function() {
278
+ this._view.setCursor('grab');
279
+
280
+ this._mouseDownX = this._view.getPointerPosition().x;
281
+ this._initialStartTime = this._segment.startTime;
282
+ this._initialStartPixel = this._view.timeToPixels(this._initialStartTime);
283
+ this._initialEndTime = this._segment.endTime;
284
+ this._initialEndPixel = this._view.timeToPixels(this._initialEndTime);
285
+
286
+ this._peaks.emit('segments.dragstart', this._segment);
287
+ };
288
+
289
+ SegmentShape.prototype._onSegmentDragEnd = function() {
290
+ this._view.setCursor('pointer');
291
+
292
+ this._peaks.emit('segments.dragend', this._segment);
293
+ };
294
+
295
+ /**
296
+ * @param {SegmentMarker} segmentMarker
297
+ */
298
+
299
+ SegmentShape.prototype._onSegmentHandleDrag = function() {
300
+ this._peaks.emit('segments.dragged');
301
+ };
302
+
303
+ /**
304
+ * @param {SegmentMarker} segmentMarker
305
+ */
306
+
307
+ SegmentShape.prototype._onSegmentHandleDragStart = function(segmentMarker) {
308
+ var startMarker = segmentMarker.isStartMarker();
309
+
310
+ this._peaks.emit('segments.dragstart', this._segment, startMarker);
311
+ };
312
+
313
+ /**
314
+ * @param {SegmentMarker} segmentMarker
315
+ */
316
+
317
+ SegmentShape.prototype._onSegmentHandleDragEnd = function(segmentMarker) {
318
+ var startMarker = segmentMarker.isStartMarker();
319
+
320
+ this._peaks.emit('segments.dragend', this._segment, startMarker);
321
+ };
322
+
323
+ SegmentShape.prototype.setSelected = function(isSelected) {
324
+ this._isSelected = isSelected;
325
+ };
326
+
327
+ SegmentShape.prototype.fitToView = function() {
328
+ if (this._startMarker) {
329
+ this._startMarker.fitToView();
330
+ }
331
+
332
+ if (this._endMarker) {
333
+ this._endMarker.fitToView();
334
+ }
335
+ };
336
+
337
+ SegmentShape.prototype.destroy = function() {
338
+ this._rectangle.destroy();
339
+
340
+ if (this._label) {
341
+ this._label.destroy();
342
+ }
343
+
344
+ if (this._startMarker) {
345
+ this._startMarker.destroy();
346
+ }
347
+
348
+ if (this._endMarker) {
349
+ this._endMarker.destroy();
350
+ }
351
+ };
352
+
353
+ return SegmentShape;
354
+ });