From: Kriss Date: Thu, 17 Dec 2015 22:00:12 +0000 (+0000) Subject: maxRotation test is off by one X-Git-Tag: 2.0.0-beta2~17^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F1797%2Fhead;p=thirdparty%2FChart.js.git 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. --- 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));