From 8560a7131296fac72a87f6f2b4fe31625bff38a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 8 May 2014 13:54:05 +0100 Subject: [PATCH] Remove srcOffset and dstOffset parameters from Matrix#_transformCoordinates(). --- src/basic/Matrix.js | 19 ++++++++----------- src/path/Curve.js | 2 +- src/path/Segment.js | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/basic/Matrix.js b/src/basic/Matrix.js index 95fc8623..0ee17058 100644 --- a/src/basic/Matrix.js +++ b/src/basic/Matrix.js @@ -435,19 +435,16 @@ var Matrix = Base.extend(/** @lends Matrix# */{ * @function * @param {Number[]} src the array containing the source points * as x, y value pairs - * @param {Number} srcOffset the offset to the first point to be transformed * @param {Number[]} dst the array into which to store the transformed * point pairs - * @param {Number} dstOffset the offset of the location of the first - * transformed point in the destination array * @param {Number} count the number of points to tranform * @return {Number[]} the dst array, containing the transformed coordinates. */ - transform: function(/* point | */ src, srcOffset, dst, dstOffset, count) { - return arguments.length < 5 + transform: function(/* point | */ src, dst, count) { + return arguments.length < 3 // TODO: Check for rectangle and use _tranformBounds? ? this._transformPoint(Point.read(arguments)) - : this._transformCoordinates(src, srcOffset, dst, dstOffset, count); + : this._transformCoordinates(src, dst, count); }, /** @@ -466,10 +463,10 @@ var Matrix = Base.extend(/** @lends Matrix# */{ ); }, - _transformCoordinates: function(src, srcOffset, dst, dstOffset, count) { - var i = srcOffset, - j = dstOffset, - max = i + 2 * count; + _transformCoordinates: function(src, dst, count) { + var i = 0, + j = 0, + max = 2 * count; while (i < max) { var x = src[i++], y = src[i++]; @@ -485,7 +482,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{ x2 = x1 + rect.width, y2 = y1 + rect.height, coords = [ x1, y1, x2, y1, x2, y2, x1, y2 ]; - return this._transformCoordinates(coords, 0, coords, 0, 4); + return this._transformCoordinates(coords, coords, 4); }, /** diff --git a/src/path/Curve.js b/src/path/Curve.js index 2fd35144..6ab9c427 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -481,7 +481,7 @@ statics: { p2._x, p2._y ]; if (matrix) - matrix._transformCoordinates(values, 0, values, 0, 6); + matrix._transformCoordinates(values, values, 6); return values; }, diff --git a/src/path/Segment.js b/src/path/Segment.js index 8c3fcda8..a28d1b99 100644 --- a/src/path/Segment.js +++ b/src/path/Segment.js @@ -525,7 +525,7 @@ var Segment = Base.extend(/** @lends Segment# */{ // If no matrix was previded, this was just called to get the coords and // we are done now. if (matrix) { - matrix._transformCoordinates(coords, 0, coords, 0, i / 2); + matrix._transformCoordinates(coords, coords, i / 2); x = coords[0]; y = coords[1]; if (change) {