@@ -511,13 +511,12 @@ function drawColorBar(g, opts, gd) {
511
511
}
512
512
513
513
var outerwidth = 2 * xpad + innerWidth + borderwidth + outlinewidth / 2 ;
514
- var outerheight = lenPx ;
515
514
516
515
g . select ( '.' + cn . cbbg ) . attr ( {
517
516
x : uPx - xpad - ( borderwidth + outlinewidth ) / 2 ,
518
517
y : vPx - lenPx - yExtraPx ,
519
518
width : Math . max ( outerwidth , 2 ) ,
520
- height : Math . max ( outerheight + 2 * yExtraPx , 2 )
519
+ height : Math . max ( lenPx + 2 * yExtraPx , 2 )
521
520
} )
522
521
. call ( Color . fill , opts . bgcolor )
523
522
. call ( Color . stroke , opts . bordercolor )
@@ -527,7 +526,7 @@ function drawColorBar(g, opts, gd) {
527
526
x : uPx ,
528
527
y : vPx - lenPx + ypad + ( titleSide === 'top' ? titleHeight : 0 ) ,
529
528
width : Math . max ( thickPx , 2 ) ,
530
- height : Math . max ( outerheight - 2 * ypad - titleHeight , 2 )
529
+ height : Math . max ( lenPx - 2 * ypad - titleHeight , 2 )
531
530
} )
532
531
. call ( Color . stroke , opts . outlinecolor )
533
532
. style ( {
@@ -545,8 +544,8 @@ function drawColorBar(g, opts, gd) {
545
544
var bFrac = FROM_BR [ yanchor ] ;
546
545
if ( lenmode === 'pixels' ) {
547
546
marginOpts . y = optsY ;
548
- marginOpts . t = outerheight * tFrac ;
549
- marginOpts . b = outerheight * bFrac ;
547
+ marginOpts . t = lenPx * tFrac ;
548
+ marginOpts . b = lenPx * bFrac ;
550
549
} else {
551
550
marginOpts . t = marginOpts . b = 0 ;
552
551
marginOpts . yt = optsY + len * tFrac ;
0 commit comments