File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 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) {
114114
115115 var text = drawLabel ( labelGroup , { step : stepOpts } , sliderOpts ) ;
116116
117- var tWidth = text . node ( ) && Drawing . bBox ( text . node ( ) ) . width ;
117+ var tWidth = ( text . node ( ) && Drawing . bBox ( text . node ( ) ) . width ) || 0 ;
118118
119119 // This just overwrites with the last. Which is fine as long as
120120 // the bounding box (probably incorrectly) measures the text *on
121121 // a single line*:
122- labelHeight = text . node ( ) && Drawing . bBox ( text . node ( ) ) . height ;
122+ labelHeight = ( text . node ( ) && Drawing . bBox ( text . node ( ) ) . height ) || 0 ;
123123
124124 maxLabelWidth = Math . max ( maxLabelWidth , tWidth ) ;
125125 } ) ;
@@ -141,7 +141,7 @@ function findDimensions(gd, sliderOpts) {
141141
142142 sliderLabels . each ( function ( stepOpts ) {
143143 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 } ;
145145 sliderOpts . currentValueMaxWidth = Math . max ( sliderOpts . currentValueMaxWidth , Math . ceil ( curValSize . width ) ) ;
146146 sliderOpts . currentValueHeight = Math . max ( sliderOpts . currentValueHeight , Math . ceil ( curValSize . height ) ) ;
147147 } ) ;
You can’t perform that action at this time.
0 commit comments