Skip to content

Commit d04af25

Browse files
author
Jakub Hranicky
committed
Fix typos and add borderAliasPixel variable
1 parent eb094f5 commit d04af25

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/core/core.scale.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -923,14 +923,15 @@ module.exports = function(Chart) {
923923
var y1 = Math.round(me.top);
924924
var y2 = Math.round(me.bottom);
925925

926+
var borderAliasPixel = helpers.aliasPixel(context.lineWidth);
926927
if (isHorizontal) {
927928
y1 = y2 = options.position === 'top' ? me.bottom : me.top;
928-
y1 += helpers.aliasPixel(context.lineWidth);
929-
y2 += helpers.aliasPixel(context.lineWidth);
929+
y1 += borderAliasPixel;
930+
y2 += borderAliasPixel;
930931
} else {
931932
x1 = x2 = options.position === 'left' ? me.right : me.left;
932-
x1 += helpers.aliasPixel(context.lineWidth);
933-
x2 += helpers.aliasPixel(context.lineWidth);
933+
x1 += borderAliasPixel;
934+
x2 += borderAliasPixel;
934935
}
935936

936937
context.beginPath();

src/plugins/plugin.gridlines.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = function() {
7474
// Marks scale border positions to prevent overlapping of gridLines and scale borders
7575
helpers.each(chart.scales, function(scale) {
7676
var scaleOptions = scale.options;
77-
var glHashByOrientantion = gridLinesHash[!scale.isHorizontal() ? 'horizontal' : 'vertical'];
77+
var glHashByOrientation = gridLinesHash[!scale.isHorizontal() ? 'horizontal' : 'vertical'];
7878
var borderPosition;
7979

8080
// gridLines.drawBorder is deprecated
@@ -85,14 +85,14 @@ module.exports = function() {
8585
borderPosition = scale.position === 'left' ? scale.right : scale.left;
8686
}
8787

88-
glHashByOrientantion[Math.round(borderPosition)] = true;
88+
glHashByOrientation[Math.round(borderPosition)] = true;
8989
}
9090
});
9191

9292
// Collects gridLines
9393
helpers.each(chart.scales, function(scale) {
9494
var scaleOptions = scale.options;
95-
var glHashByOrientantion = gridLinesHash[scale.isHorizontal() ? 'horizontal' : 'vertical'];
95+
var glHashByOrientation = gridLinesHash[scale.isHorizontal() ? 'horizontal' : 'vertical'];
9696
var position;
9797

9898
if (scaleOptions.display && scaleOptions.gridLines.display && scaleOptions.gridLines.drawOnChartArea) {
@@ -103,8 +103,8 @@ module.exports = function() {
103103

104104
position = getLineValue(scale, tickIndex, scaleOptions.gridLines.offsetGridLines && ticksCount > 1);
105105

106-
if (glHashByOrientantion[position] === undefined) {
107-
glHashByOrientantion[position] = true;
106+
if (glHashByOrientation[position] === undefined) {
107+
glHashByOrientation[position] = true;
108108
lines.push(getGridLine(chart, scale, position, tickIndex));
109109
}
110110
}
@@ -114,8 +114,8 @@ module.exports = function() {
114114
if (scaleOptions.gridLines.offsetGridLines) {
115115
position = Math.round(!scale.isHorizontal() ? scale.bottom : scale.right);
116116

117-
if (glHashByOrientantion[position] === undefined) {
118-
glHashByOrientantion[position] = true;
117+
if (glHashByOrientation[position] === undefined) {
118+
glHashByOrientation[position] = true;
119119
lines.push(getGridLine(chart, scale, position, undefined));
120120
}
121121
}

0 commit comments

Comments
 (0)