@@ -13,10 +13,6 @@ import SegmentMarker from './segment-marker';
13
13
import WaveformShape from './waveform-shape' ;
14
14
import { clamp } from './utils' ;
15
15
16
- const defaultFontFamily = 'sans-serif' ;
17
- const defaultFontSize = 10 ;
18
- const defaultFontShape = 'normal' ;
19
-
20
16
/**
21
17
* Options that control segments' visual appearance
22
18
*
@@ -67,7 +63,8 @@ function SegmentShape(segment, peaks, layer, view) {
67
63
this . _draggable = this . _segment . editable && this . _view . isSegmentDraggingEnabled ( ) ;
68
64
this . _dragging = false ;
69
65
70
- const segmentOptions = view . getViewOptions ( ) . segmentOptions ;
66
+ const viewOptions = view . getViewOptions ( ) ;
67
+ const segmentOptions = viewOptions . segmentOptions ;
71
68
72
69
this . _overlayOffset = segmentOptions . overlayOffset ;
73
70
@@ -100,9 +97,9 @@ function SegmentShape(segment, peaks, layer, view) {
100
97
segment : segment ,
101
98
view : this . _view . getName ( ) ,
102
99
layer : this . _layer ,
103
- fontFamily : this . _peaks . options . fontFamily ,
104
- fontSize : this . _peaks . options . fontSize ,
105
- fontStyle : this . _peaks . options . fontStyle
100
+ fontFamily : viewOptions . fontFamily ,
101
+ fontSize : viewOptions . fontSize ,
102
+ fontStyle : viewOptions . fontStyle
106
103
} ) ;
107
104
108
105
if ( this . _label ) {
@@ -200,7 +197,8 @@ function createOverlayMarker(options) {
200
197
201
198
SegmentShape . prototype . _createMarkers = function ( ) {
202
199
const editable = this . _layer . isEditingEnabled ( ) && this . _segment . editable ;
203
- const segmentOptions = this . _view . getViewOptions ( ) . segmentOptions ;
200
+ const viewOptions = this . _view . getViewOptions ( ) ;
201
+ const segmentOptions = viewOptions . segmentOptions ;
204
202
205
203
let createSegmentMarker , startMarker , endMarker ;
206
204
@@ -217,9 +215,9 @@ SegmentShape.prototype._createMarkers = function() {
217
215
editable : editable ,
218
216
startMarker : true ,
219
217
color : segmentOptions . startMarkerColor ,
220
- fontFamily : this . _peaks . options . fontFamily || defaultFontFamily ,
221
- fontSize : this . _peaks . options . fontSize || defaultFontSize ,
222
- fontStyle : this . _peaks . options . fontStyle || defaultFontShape ,
218
+ fontFamily : viewOptions . fontFamily ,
219
+ fontSize : viewOptions . fontSize ,
220
+ fontStyle : viewOptions . fontStyle ,
223
221
layer : this . _layer ,
224
222
view : this . _view . getName ( ) ,
225
223
segmentOptions : this . _view . getViewOptions ( ) . segmentOptions
@@ -247,9 +245,9 @@ SegmentShape.prototype._createMarkers = function() {
247
245
editable : editable ,
248
246
startMarker : false ,
249
247
color : segmentOptions . endMarkerColor ,
250
- fontFamily : this . _peaks . options . fontFamily || defaultFontFamily ,
251
- fontSize : this . _peaks . options . fontSize || defaultFontSize ,
252
- fontStyle : this . _peaks . options . fontStyle || defaultFontShape ,
248
+ fontFamily : viewOptions . fontFamily ,
249
+ fontSize : viewOptions . fontSize ,
250
+ fontStyle : viewOptions . fontStyle ,
253
251
layer : this . _layer ,
254
252
view : this . _view . getName ( ) ,
255
253
segmentOptions : this . _view . getViewOptions ( ) . segmentOptions
0 commit comments