Skip to content

Commit 19fb1f3

Browse files
committed
use lenPx in place of outerheight
1 parent ace3525 commit 19fb1f3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/colorbar/draw.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,12 @@ function drawColorBar(g, opts, gd) {
511511
}
512512

513513
var outerwidth = 2 * xpad + innerWidth + borderwidth + outlinewidth / 2;
514-
var outerheight = lenPx;
515514

516515
g.select('.' + cn.cbbg).attr({
517516
x: uPx - xpad - (borderwidth + outlinewidth) / 2,
518517
y: vPx - lenPx - yExtraPx,
519518
width: Math.max(outerwidth, 2),
520-
height: Math.max(outerheight + 2 * yExtraPx, 2)
519+
height: Math.max(lenPx + 2 * yExtraPx, 2)
521520
})
522521
.call(Color.fill, opts.bgcolor)
523522
.call(Color.stroke, opts.bordercolor)
@@ -527,7 +526,7 @@ function drawColorBar(g, opts, gd) {
527526
x: uPx,
528527
y: vPx - lenPx + ypad + (titleSide === 'top' ? titleHeight : 0),
529528
width: Math.max(thickPx, 2),
530-
height: Math.max(outerheight - 2 * ypad - titleHeight, 2)
529+
height: Math.max(lenPx - 2 * ypad - titleHeight, 2)
531530
})
532531
.call(Color.stroke, opts.outlinecolor)
533532
.style({
@@ -545,8 +544,8 @@ function drawColorBar(g, opts, gd) {
545544
var bFrac = FROM_BR[yanchor];
546545
if(lenmode === 'pixels') {
547546
marginOpts.y = optsY;
548-
marginOpts.t = outerheight * tFrac;
549-
marginOpts.b = outerheight * bFrac;
547+
marginOpts.t = lenPx * tFrac;
548+
marginOpts.b = lenPx * bFrac;
550549
} else {
551550
marginOpts.t = marginOpts.b = 0;
552551
marginOpts.yt = optsY + len * tFrac;

0 commit comments

Comments
 (0)