File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -114,12 +114,12 @@ function findDimensions(gd, sliderOpts) {
114
114
115
115
var text = drawLabel ( labelGroup , { step : stepOpts } , sliderOpts ) ;
116
116
117
- var tWidth = text . node ( ) && Drawing . bBox ( text . node ( ) ) . width ;
117
+ var tWidth = ( text . node ( ) && Drawing . bBox ( text . node ( ) ) . width ) || 0 ;
118
118
119
119
// This just overwrites with the last. Which is fine as long as
120
120
// the bounding box (probably incorrectly) measures the text *on
121
121
// a single line*:
122
- labelHeight = text . node ( ) && Drawing . bBox ( text . node ( ) ) . height ;
122
+ labelHeight = ( text . node ( ) && Drawing . bBox ( text . node ( ) ) . height ) || 0 ;
123
123
124
124
maxLabelWidth = Math . max ( maxLabelWidth , tWidth ) ;
125
125
} ) ;
@@ -141,7 +141,7 @@ function findDimensions(gd, sliderOpts) {
141
141
142
142
sliderLabels . each ( function ( stepOpts ) {
143
143
var curValPrefix = drawCurrentValue ( dummyGroup , sliderOpts , stepOpts . label ) ;
144
- var curValSize = curValPrefix . node ( ) && Drawing . bBox ( curValPrefix . node ( ) ) ;
144
+ var curValSize = ( curValPrefix . node ( ) && Drawing . bBox ( curValPrefix . node ( ) ) ) || { width : 0 , height : 0 } ;
145
145
sliderOpts . currentValueMaxWidth = Math . max ( sliderOpts . currentValueMaxWidth , Math . ceil ( curValSize . width ) ) ;
146
146
sliderOpts . currentValueHeight = Math . max ( sliderOpts . currentValueHeight , Math . ceil ( curValSize . height ) ) ;
147
147
} ) ;
You can’t perform that action at this time.
0 commit comments