From 3940f4b598ebd87c5b32c731d09c075fd03657ac Mon Sep 17 00:00:00 2001 From: Jani Patokallio Date: Thu, 7 May 2015 00:14:41 +1000 Subject: [PATCH] Fix off-by-1 error for computing step sizes (#184) --- lib/torque/provider/windshaft.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/torque/provider/windshaft.js b/lib/torque/provider/windshaft.js index 5aed40a..ae37dc2 100644 --- a/lib/torque/provider/windshaft.js +++ b/lib/torque/provider/windshaft.js @@ -194,7 +194,8 @@ opt = opt || {}; if (this.options.steps !== steps) { this.options.steps = steps; - this.options.step = (this.options.end - this.options.start)/this.getSteps(); + // If you have N frames, there are N-1 steps between them + this.options.step = (this.options.end - this.options.start) / (this.getSteps() - 1); this.options.step = this.options.step || 1; if (!opt.silent) this.reload(); }