Use Matrix concat
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ece2ee33 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ece2ee33 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ece2ee33 Branch: refs/heads/master Commit: ece2ee33a1f6c43f8c46992cb692c69564d9f711 Parents: 518f717 Author: Harbs <[email protected]> Authored: Sun Aug 14 22:49:17 2016 +0300 Committer: Harbs <[email protected]> Committed: Sun Aug 14 22:49:17 2016 +0300 ---------------------------------------------------------------------- .../apache/flex/core/TransformCompoundModel.as | 30 ++------------------ 1 file changed, 2 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ece2ee33/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as index 9418fd1..ab7c12c 100644 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as @@ -32,7 +32,7 @@ package org.apache.flex.core for (var i:int = 1; i < length; i++) { var current:Matrix = (value[i] as ITransformModel).matrix; - concat(product, current); + product.concat(current); } matrix = product; } else @@ -40,31 +40,5 @@ package org.apache.flex.core matrix = null; } } - - private function concat(product:Matrix, factor:Matrix):void - { - var result_a:Number = product.a * factor.a; - var result_b:Number = 0.0; - var result_c:Number = 0.0; - var result_d:Number = product.d * factor.d; - var result_tx:Number = product.tx * factor.a + factor.tx; - var result_ty:Number = product.ty * factor.d + factor.ty; - if (product.b != 0.0 || product.c != 0.0 || factor.b != 0.0 || factor.c != 0.0) - { - result_a = result_a + product.b * factor.c; - result_d = result_d + product.c * factor.b; - result_b = result_b + (product.a * factor.b + product.b * factor.d); - result_c = result_c + (product.c * factor.a + product.d * factor.c); - result_tx = result_tx + product.ty * factor.c; - result_ty = result_ty + product.tx * factor.b; - } - product.a = result_a; - product.b = result_b; - product.c = result_c; - product.d = result_d; - product.tx = result_tx; - product.ty = result_ty; - } - } -} \ No newline at end of file +}
