Skip to content

Commit

Permalink
use caretX instead of xCaret
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidohallik committed Nov 9, 2017
1 parent ef18a57 commit dd668a3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/core/core.tooltip.js
Expand Up @@ -339,7 +339,6 @@ module.exports = function(Chart) {
function getBackgroundPoint(vm, size, alignment, chart) {
// Background Position
var x = vm.x;
var xCaret;
var y = vm.y;

var caretSize = vm.caretSize;
Expand All @@ -354,7 +353,6 @@ module.exports = function(Chart) {
x -= size.width;
} else if (xAlign === 'center') {
x -= (size.width / 2);
xCaret = x;
if (x + size.width > chart.width) {
x = chart.width - size.width;
}
Expand Down Expand Up @@ -385,7 +383,6 @@ module.exports = function(Chart) {

return {
x: x,
xCaret: xCaret,
y: y
};
}
Expand Down Expand Up @@ -487,7 +484,6 @@ module.exports = function(Chart) {
};
var backgroundPoint = {
x: existingModel.x,
xCaret: existingModel.xCaret,
y: existingModel.y
};
var tooltipSize = {
Expand Down Expand Up @@ -563,7 +559,6 @@ module.exports = function(Chart) {
model.xAlign = alignment.xAlign;
model.yAlign = alignment.yAlign;
model.x = backgroundPoint.x;
model.xCaret = backgroundPoint.xCaret;
model.y = backgroundPoint.y;
model.width = tooltipSize.width;
model.height = tooltipSize.height;
Expand Down Expand Up @@ -628,11 +623,7 @@ module.exports = function(Chart) {
x1 = x2 - caretSize;
x3 = x2 + caretSize;
} else {
if (tooltipPoint.xCaret) {
x2 = tooltipPoint.xCaret + (width / 2);
} else {
x2 = ptX + (width / 2);
}
x2 = vm.caretX;
x1 = x2 - caretSize;
x3 = x2 + caretSize;
}
Expand Down Expand Up @@ -810,7 +801,6 @@ module.exports = function(Chart) {
};
var pt = {
x: vm.x,
xCaret: vm.xCaret,
y: vm.y
};

Expand Down

0 comments on commit dd668a3

Please sign in to comment.