Kaydet (Commit) 3a744902 authored tarafından Rohan Kumar's avatar Rohan Kumar Kaydeden (comit) Thorsten Behrens

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/36903Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst b647f9f4
...@@ -10644,6 +10644,7 @@ SnakeWipePath.prototype.perform = function(nT) { ...@@ -10644,6 +10644,7 @@ SnakeWipePath.prototype.perform = function(nT) {
} }
/** Class ParallelSnakesWipePath /** Class ParallelSnakesWipePath
* Generates a parallel snakes wipe:
* *
* @param nElements * @param nElements
* @param bDiagonal * @param bDiagonal
...@@ -10682,8 +10683,8 @@ ParallelSnakesWipePath.prototype.perform = function( nT ) { ...@@ -10682,8 +10683,8 @@ ParallelSnakesWipePath.prototype.perform = function( nT ) {
half = SnakeWipePath.prototype.calcSnake.call(this, nT / 2.0 ); half = SnakeWipePath.prototype.calcSnake.call(this, nT / 2.0 );
// rotate 90 degrees // rotate 90 degrees
aTransform = SVGIdentityMatrix.translate(-0.5, -0.5); aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
aTransform.rotate(Math.PI/2); aTransform = aTransform.rotate(Math.PI/2);
aTransform.translate(0.5, 0.5); aTransform = aTransform.translate(0.5, 0.5);
half.matrixTransform(aTransform); half.matrixTransform(aTransform);
res.appendPath(flipOnYAxis(half)); res.appendPath(flipOnYAxis(half));
res.appendPath(this.bOpposite ? flipOnXAxis(half) : half); res.appendPath(this.bOpposite ? flipOnXAxis(half) : half);
...@@ -10713,11 +10714,11 @@ SpiralWipePath.prototype.calcNegSpiral = function( nT ) { ...@@ -10713,11 +10714,11 @@ SpiralWipePath.prototype.calcNegSpiral = function( nT ) {
var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5); var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
var edge_ = pruneScaleValue(edge / this.sqrtElements); var edge_ = pruneScaleValue(edge / this.sqrtElements);
aTransform.scale(edge_, edge_); aTransform = aTransform.scale(edge_, edge_);
aTransform.translate(0.5, 0.5); aTransform = aTransform.translate(0.5, 0.5);
var poly = createUnitSquarePath(); var poly = createUnitSquarePath();
poly.matrixTransform(aTransform); poly.matrixTransform(aTransform);
var res = poly; var res = poly.cloneNode(true);
if(1.0 - nT != 0) { if(1.0 - nT != 0) {
var edge1 = edge + 1; var edge1 = edge + 1;
...@@ -10731,12 +10732,12 @@ SpiralWipePath.prototype.calcNegSpiral = function( nT ) { ...@@ -10731,12 +10732,12 @@ SpiralWipePath.prototype.calcNegSpiral = function( nT ) {
aTransform = SVGIdentityMatrix.scale( aTransform = SVGIdentityMatrix.scale(
pruneScaleValue( alen / this.sqrtElements ), pruneScaleValue( alen / this.sqrtElements ),
pruneScaleValue( 1.0 / this.sqrtElements )); pruneScaleValue( 1.0 / this.sqrtElements ));
aTransform.translate( aTransform = aTransform.translate(
- pruneScaleValue( (edge / 2) / this.sqrtElements ), - pruneScaleValue( (edge / 2) / this.sqrtElements ),
pruneScaleValue( (edge / 2) / this.sqrtElements )); pruneScaleValue( (edge / 2) / this.sqrtElements ));
aTransform.rotate( w ); aTransform = aTransform.rotate( w );
w -= Math.PI / 2; w -= Math.PI / 2;
aTransform.translate(0.5, 0.5); aTransform = aTransform.translate(0.5, 0.5);
poly.matrixTransform(aTransform); poly.matrixTransform(aTransform);
res.appendPath(poly); res.appendPath(poly);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment