Skip to content

Commit b1e8fff

Browse files
committed
account for line spacing
1 parent ea934c3 commit b1e8fff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/traces/bar/cross_trace_calc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var getAxisGroup = require('../../plots/cartesian/constraints').getAxisGroup;
1010
var Sieve = require('./sieve.js');
1111

1212
var TEXTPAD = require('./constants').TEXTPAD;
13+
var LINE_SPACING = require('../../constants/alignment').LINE_SPACING;
1314
var BR_TAG_ALL = require('../../lib/svg_text_utils').BR_TAG_ALL;
1415

1516
/*
@@ -797,7 +798,7 @@ function estimateAxisPaddingForText(trace, calcTrace) {
797798
? Math.max(...trace.text.map((t) => countLines(t)))
798799
: countLines(trace.text);
799800

800-
const padAmount = trace.outsidetextfont.size * nLines + TEXTPAD;
801+
const padAmount = trace.outsidetextfont.size * LINE_SPACING * nLines + TEXTPAD;
801802
return {
802803
// Yes, I know this looks backwards from what it should be,
803804
// but it works like this

0 commit comments

Comments
 (0)