From 41c3ce8b17c42362e618efaf57a69fbb24c2c47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Wed, 23 Dec 2015 16:17:41 +0100 Subject: [PATCH] :lipstick: Useless `image` param --- bundle.js | 8 +++----- scripts/chaos.js | 3 +-- scripts/index.js | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bundle.js b/bundle.js index 91063fd..991dc3d 100644 --- a/bundle.js +++ b/bundle.js @@ -495,14 +495,13 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const * the next `n` points. To get to the next point, we apply * a random transformation among given ones * - * @param {ImageData} image Image to write on * @param {Array} start Starting point * @param {number} iterations Number of points to plot * @param {Array} transforms List of available transforms * @param {Array} weights Probability weights for each transform * @return {null} */ - var applyChaos = exports.applyChaos = function applyChaos(image, start, iterations, transforms, weights, cb) { + var applyChaos = exports.applyChaos = function applyChaos(start, iterations, transforms, weights, cb) { var point = start; if (weights === undefined) { @@ -519,12 +518,11 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const } }; }, {}], 7: [function (require, module, exports) { - "use strict"; + 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); - var linearTransform = function linearTransform(a, b, c, d, e, f) { return function (point) { return [a * point[0] + b * point[1] + e, c * point[0] + d * point[1] + f]; @@ -592,7 +590,7 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const var color = [0, 0, 0]; var skip = 50; - _chaos.applyChaos.apply(undefined, [image, [0, 0], 500000].concat(_toConsumableArray(_ifs.barnsley), [function (point) { + _chaos.applyChaos.apply(undefined, [[0, 0], 200000].concat(_toConsumableArray(_ifs.barnsley), [function (point) { var x = Math.floor(point[0] * zoom + center[0]); var y = height - Math.floor(point[1] * zoom + center[1]); diff --git a/scripts/chaos.js b/scripts/chaos.js index f19f85d..adedbe8 100644 --- a/scripts/chaos.js +++ b/scripts/chaos.js @@ -24,14 +24,13 @@ const chooseIndex = weights => { * the next `n` points. To get to the next point, we apply * a random transformation among given ones * - * @param {ImageData} image Image to write on * @param {Array} start Starting point * @param {number} iterations Number of points to plot * @param {Array} transforms List of available transforms * @param {Array} weights Probability weights for each transform * @return {null} */ -export const applyChaos = (image, start, iterations, transforms, weights, cb) => { +export const applyChaos = (start, iterations, transforms, weights, cb) => { let point = start; if (weights === undefined) { diff --git a/scripts/index.js b/scripts/index.js index 1f9f515..5c8579c 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -33,7 +33,7 @@ const render = () => { const color = [0, 0, 0]; let skip = 50; - applyChaos(image, [0, 0], 500000, ...barnsley, point => { + applyChaos([0, 0], 200000, ...barnsley, point => { const x = Math.floor(point[0] * zoom + center[0]); const y = height - Math.floor(point[1] * zoom + center[1]);