From 18068cb33818386dfb3e6578f4854ba6f1ed5089 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Tue, 8 Oct 2019 14:37:41 +0200 Subject: [PATCH] check lower bound --- src/legacy/ui/public/vislib/lib/axis/axis_labels.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/legacy/ui/public/vislib/lib/axis/axis_labels.js b/src/legacy/ui/public/vislib/lib/axis/axis_labels.js index 85189a373dc2b..d5ed0b9e12f21 100644 --- a/src/legacy/ui/public/vislib/lib/axis/axis_labels.js +++ b/src/legacy/ui/public/vislib/lib/axis/axis_labels.js @@ -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;