Skip to content

Commit

Permalink
check lower bound
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Oct 8, 2019
1 parent 9b0c212 commit 18068cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/legacy/ui/public/vislib/lib/axis/axis_labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ export class AxisLabels {
const currentTickStartEdge = currentTickCenter - currentTickHalfSize;
const currentTickEndEdge = currentTickCenter + currentTickHalfSize;

const outsideUpperBound = maxSize <= (currentTickCenter + currentTickHalfSize);
const outsideUpperBound = maxSize < currentTickEndEdge > maxSize;
const outsideLowerBound = currentTickStartEdge < 0;
const overlapsLastTick = (currentTickEndEdge >= lastTickStartEdge && currentTickStartEdge <= lastTickEndEdge);

if (outsideUpperBound || overlapsLastTick) {
if (outsideUpperBound || outsideLowerBound || overlapsLastTick) {
d3.select(this.parentNode).remove();
} else {
lastTickStartEdge = currentTickCenter - currentTickHalfSize;
Expand Down

0 comments on commit 18068cb

Please sign in to comment.