@@ -651,21 +651,22 @@ function drawColorBar(g, opts, gd) {
651651 ypad
652652 ) * 2 + innerThickness + borderwidth + outlinewidth / 2 ;
653653
654- var gapTitleHColorbar = 0 ;
654+ var hColorbarMoveTitle = 0 ;
655655 if ( ! isVertical && title . text && optsY <= 0 ) {
656- gapTitleHColorbar = outerThickness / 2 ;
656+ hColorbarMoveTitle = outerThickness / 2 ;
657657
658- outerThickness += gapTitleHColorbar ;
659- moveY += gapTitleHColorbar ;
658+ outerThickness += hColorbarMoveTitle ;
659+ moveY += hColorbarMoveTitle ;
660660 }
661- gd . _fullLayout . _gapTitleHColorbar = gapTitleHColorbar ;
661+ fullLayout . _hColorbarMoveTitle = hColorbarMoveTitle ;
662+ fullLayout . _hColorbarMoveCBTitle = moveY ;
662663
663664 var extraW = borderwidth + outlinewidth ;
664665
665666 g . select ( '.' + cn . cbbg )
666667 . attr ( 'x' , ( isVertical ? uPx : vPx ) - extraW / 2 - ( isVertical ? xpad : 0 ) )
667- . attr ( 'y' , ( isVertical ? vPx : uPx ) - ( isVertical ? lenPx : ypad + moveY - gapTitleHColorbar ) )
668- . attr ( isVertical ? 'width' : 'height' , Math . max ( outerThickness - gapTitleHColorbar , 2 ) )
668+ . attr ( 'y' , ( isVertical ? vPx : uPx ) - ( isVertical ? lenPx : ypad + moveY - hColorbarMoveTitle ) )
669+ . attr ( isVertical ? 'width' : 'height' , Math . max ( outerThickness - hColorbarMoveTitle , 2 ) )
669670 . attr ( isVertical ? 'height' : 'width' , Math . max ( lenPx + extraW , 2 ) )
670671 . call ( Color . fill , opts . bgcolor )
671672 . call ( Color . stroke , opts . bordercolor )
0 commit comments