From d9363d637a8fec511c06b03a262f3d04a92313b4 Mon Sep 17 00:00:00 2001 From: Kriss Date: Thu, 17 Dec 2015 22:00:12 +0000 Subject: [PATCH] maxRotation test is off by one Most notable when maxRotation=0 and you end up with the text becoming non centred as it has rotated it by 1 and switched to right alligned mode. --- src/core/core.scale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 6f15033e6..aa8161684 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -180,7 +180,7 @@ var tickWidth = this.getPixelForTick(1) - this.getPixelForTick(0) - 6; //Max label rotation can be set or default to 90 - also act as a loop counter - while (this.labelWidth > tickWidth && this.labelRotation <= this.options.ticks.maxRotation) { + while (this.labelWidth > tickWidth && this.labelRotation < this.options.ticks.maxRotation) { cosRotation = Math.cos(helpers.toRadians(this.labelRotation)); sinRotation = Math.sin(helpers.toRadians(this.labelRotation)); -- 2.47.2