[Libreoffice-commits] core.git: filter/source
Rohan Kumar
rohankanojia420 at gmail.com
Mon May 1 12:26:48 UTC 2017
filter/source/svg/presentation_engine.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
New commits:
commit 3a74490276de107bd57859d5aa52829593807c01
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Thu Apr 20 17:58:26 2017 +0530
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 at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
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);
}
More information about the Libreoffice-commits
mailing list