diff options
author | Rohan Kumar <rohankanojia420@gmail.com> | 2017-04-20 17:58:26 +0530 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-05-01 14:26:17 +0200 |
commit | 3a74490276de107bd57859d5aa52829593807c01 (patch) | |
tree | 7307dc3b4a8c6375e2460404c44506340705f7d7 | |
parent | b647f9f4bcb24ed9b71c77038da6b754b8d42eb7 (diff) |
Fixed my mistake: Fix Rotation issue in ParallelSnakesWipe
seems like SVGMatrix.translate() and its counterparts doesn't
modify the matrix inplace.
Change-Id: I3ccfbe99f58cd455e291d4d41657a104ec197e83
Reviewed-on: https://gerrit.libreoffice.org/36903
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | filter/source/svg/presentation_engine.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 55b0221c7563..6f569f72a9b3 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -10644,6 +10644,7 @@ SnakeWipePath.prototype.perform = function(nT) { } /** Class ParallelSnakesWipePath + * Generates a parallel snakes wipe: * * @param nElements * @param bDiagonal @@ -10682,8 +10683,8 @@ ParallelSnakesWipePath.prototype.perform = function( nT ) { half = SnakeWipePath.prototype.calcSnake.call(this, nT / 2.0 ); // rotate 90 degrees aTransform = SVGIdentityMatrix.translate(-0.5, -0.5); - aTransform.rotate(Math.PI/2); - aTransform.translate(0.5, 0.5); + aTransform = aTransform.rotate(Math.PI/2); + aTransform = aTransform.translate(0.5, 0.5); half.matrixTransform(aTransform); res.appendPath(flipOnYAxis(half)); res.appendPath(this.bOpposite ? flipOnXAxis(half) : half); @@ -10713,11 +10714,11 @@ SpiralWipePath.prototype.calcNegSpiral = function( nT ) { var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5); var edge_ = pruneScaleValue(edge / this.sqrtElements); - aTransform.scale(edge_, edge_); - aTransform.translate(0.5, 0.5); + aTransform = aTransform.scale(edge_, edge_); + aTransform = aTransform.translate(0.5, 0.5); var poly = createUnitSquarePath(); poly.matrixTransform(aTransform); - var res = poly; + var res = poly.cloneNode(true); if(1.0 - nT != 0) { var edge1 = edge + 1; @@ -10731,12 +10732,12 @@ SpiralWipePath.prototype.calcNegSpiral = function( nT ) { aTransform = SVGIdentityMatrix.scale( pruneScaleValue( alen / this.sqrtElements ), pruneScaleValue( 1.0 / this.sqrtElements )); - aTransform.translate( + aTransform = aTransform.translate( - pruneScaleValue( (edge / 2) / this.sqrtElements ), pruneScaleValue( (edge / 2) / this.sqrtElements )); - aTransform.rotate( w ); + aTransform = aTransform.rotate( w ); w -= Math.PI / 2; - aTransform.translate(0.5, 0.5); + aTransform = aTransform.translate(0.5, 0.5); poly.matrixTransform(aTransform); res.appendPath(poly); } |