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 Mar 14, 2017
1 parent 8c3b2e2 commit d8697ed
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/core/core.tooltip.js
Expand Up @@ -331,7 +331,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 @@ -346,7 +345,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 @@ -377,7 +375,6 @@ module.exports = function(Chart) {

return {
x: x,
xCaret: xCaret,
y: y
};
}
Expand Down Expand Up @@ -478,7 +475,6 @@ module.exports = function(Chart) {
};
var backgroundPoint = {
x: existingModel.x,
xCaret: existingModel.xCaret,
y: existingModel.y
};
var tooltipSize = {
Expand Down Expand Up @@ -550,7 +546,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 @@ -616,11 +611,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 @@ -798,7 +789,6 @@ module.exports = function(Chart) {
};
var pt = {
x: vm.x,
xCaret: vm.xCaret,
y: vm.y
};

Expand Down

0 comments on commit d8697ed

Please sign in to comment.