Skip to content

Commit ec44d87

Browse files
committed
bugfix
1 parent 8b57fb5 commit ec44d87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/traces/bar/plot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ function appendBarText(gd, plotinfo, bar, cd, i, x0, x1, y0, y1, lxFunc, lyFunc,
495495
ly = lyFunc ? lyFunc(refPos) : Math.abs(y1 - y0);
496496
} else {
497497
refPos = (insidetextanchor === 'middle') ? Math.abs(y1 - y0) / 2 : TEXTPAD;
498-
lx = lxFunc ? lxFunc(TEXTPAD) : Math.abs(x1 - x0);
498+
lx = lxFunc ? lxFunc(refPos) : Math.abs(x1 - x0);
499499
ly = Math.abs(y1 - y0);
500500
}
501501
// padding excluded
@@ -641,7 +641,7 @@ function toMoveInsideBar(x0, x1, y0, y1, textBB, opts) {
641641
ly = lyFunc ? lyFunc(refPos) : Math.abs(y1 - y0);
642642
} else {
643643
refPos = (anchor === 'middle') ? Math.abs(y1 - y0) / 2 : TEXTPAD;
644-
lx = lxFunc ? lxFunc(TEXTPAD) : Math.abs(x1 - x0);
644+
lx = lxFunc ? lxFunc(refPos) : Math.abs(x1 - x0);
645645
ly = Math.abs(y1 - y0);
646646
}
647647

0 commit comments

Comments
 (0)