@@ -510,12 +510,12 @@ function drawColorBar(g, opts, gd) {
510510 innerWidth = Math . max ( innerWidth , titleWidth ) ;
511511 }
512512
513- var outerwidth = 2 * xpad + innerWidth + borderwidth + outlinewidth / 2 ;
513+ var outerThickness = 2 * xpad + innerWidth + borderwidth + outlinewidth / 2 ;
514514
515515 g . select ( '.' + cn . cbbg ) . attr ( {
516516 x : uPx - xpad - ( borderwidth + outlinewidth ) / 2 ,
517517 y : vPx - lenPx - yExtraPx ,
518- width : Math . max ( outerwidth , 2 ) ,
518+ width : Math . max ( outerThickness , 2 ) ,
519519 height : Math . max ( lenPx + 2 * yExtraPx , 2 )
520520 } )
521521 . call ( Color . fill , opts . bgcolor )
@@ -535,7 +535,7 @@ function drawColorBar(g, opts, gd) {
535535 } ) ;
536536
537537 // fix positioning for xanchor!='left'
538- var xoffset = ( { center : 0.5 , right : 1 } [ xanchor ] || 0 ) * outerwidth ;
538+ var xoffset = ( { center : 0.5 , right : 1 } [ xanchor ] || 0 ) * outerThickness ;
539539 g . attr ( 'transform' , strTranslate ( gs . l - xoffset , gs . t ) ) ;
540540
541541 // auto margin adjustment
@@ -556,10 +556,10 @@ function drawColorBar(g, opts, gd) {
556556 var rFrac = FROM_BR [ xanchor ] ;
557557 if ( thicknessmode === 'pixels' ) {
558558 marginOpts . x = optsX ;
559- marginOpts . l = outerwidth * lFrac ;
560- marginOpts . r = outerwidth * rFrac ;
559+ marginOpts . l = outerThickness * lFrac ;
560+ marginOpts . r = outerThickness * rFrac ;
561561 } else {
562- var extraThickness = outerwidth - thickPx ;
562+ var extraThickness = outerThickness - thickPx ;
563563 marginOpts . l = extraThickness * lFrac ;
564564 marginOpts . r = extraThickness * rFrac ;
565565 marginOpts . xl = optsX - thickness * lFrac ;
0 commit comments