Skip to content

Commit 1e7ebc3

Browse files
committed
Revert "Ensure correct spacing between ticklabels and ticks when using drawminorticklabel"
This reverts commit 11fd3f1. I thought label overlap with minor ticks was something I introduced with drawminorticklabel, but this was also possible before and is sometimes desired (check e.g. baseline image 24.png)
1 parent 0a80d24 commit 1e7ebc3

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

src/plots/cartesian/axes.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,31 +3150,14 @@ axes.makeLabelFns = function(ax, shift, angle) {
31503150
var isAligned = isBottom || isLeft || isTop || isRight;
31513151

31523152
var insideTickLabels = has('inside');
3153-
3154-
var minorTicksInside = ax.minor && ax.minor.ticks === 'inside';
3155-
var minorTicksOutside = ax.minor && ax.minor.ticks === 'outside';
3156-
3157-
var labelsOverMajorTicks = false;
3158-
var labelsOverMinorTicks = false;
3159-
if(insideTickLabels) {
3160-
if(ax.ticks === 'inside') {
3161-
labelsOverMajorTicks = true;
3162-
} else if(minorTicksInside) {
3163-
labelsOverMinorTicks = true;
3164-
}
3165-
} else {
3166-
if(ax.ticks === 'outside' && ax.tickson !== 'boundaries') {
3167-
labelsOverMajorTicks = true;
3168-
} else if(minorTicksOutside) {
3169-
labelsOverMinorTicks = true;
3170-
}
3171-
}
3172-
var labelsOverTicks = labelsOverMajorTicks || labelsOverMinorTicks;
3153+
var labelsOverTicks =
3154+
(ticklabelposition === 'inside' && ax.ticks === 'inside') ||
3155+
(!insideTickLabels && ax.ticks === 'outside' && ax.tickson !== 'boundaries');
31733156

31743157
var labelStandoff = 0;
31753158
var labelShift = 0;
31763159

3177-
var tickLen = labelsOverMajorTicks ? ax.ticklen : labelsOverMinorTicks ? ax.minor.ticklen : 0;
3160+
var tickLen = labelsOverTicks ? ax.ticklen : 0;
31783161
if(insideTickLabels) {
31793162
tickLen *= -1;
31803163
} else if(isAligned) {

0 commit comments

Comments
 (0)