summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-06-21 11:07:42 +0200
committerMarco Cecchetti <mrcekets@gmail.com>2016-07-01 09:51:41 +0000
commit14272dde34e2d4bf0ee31133a36145377ce74cb5 (patch)
tree941f0d5243e008f6f2ee998d2fea988cf73fcd58
parente545a1668965f4ac59673b31696a95695230fedb (diff)
bccu#1870 - added support for rotate attribute
Change-Id: I0b29fa65171c12c25122176af3c9b4e7a9c0826f Reviewed-on: https://gerrit.libreoffice.org/26835 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
-rw-r--r--filter/source/svg/presentation_engine.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
index c9222f5b44c9..4d7d6b2b0b7e 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4081,6 +4081,10 @@ var aAttributeMap =
'get': 'getOpacity',
'set': 'setOpacity' },
+ 'rotate': { 'type': NUMBER_PROPERTY,
+ 'get': 'getRotationAngle',
+ 'set': 'setRotationAngle' },
+
'width': { 'type': NUMBER_PROPERTY,
'get': 'getWidth',
'set': 'setWidth',
@@ -8801,6 +8805,7 @@ AnimatedElement.prototype.initElement = function()
this.nCenterY = this.nBaseCenterY;
this.nScaleFactorX = 1.0;
this.nScaleFactorY = 1.0;
+ this.nRotationAngle = 0.0;
// add a transform attribute of type matrix
this.aActiveElement.setAttribute( 'transform', makeMatrixString( 1, 0, 0, 1, 0, 0 ) );
@@ -8944,6 +8949,7 @@ AnimatedElement.prototype.saveState = function( nAnimationNodeId )
aState.nCenterY = this.nCenterY;
aState.nScaleFactorX = this.nScaleFactorX;
aState.nScaleFactorY = this.nScaleFactorY;
+ aState.nRotationAngle = this.nRotationAngle;
};
@@ -8975,6 +8981,7 @@ AnimatedElement.prototype.restoreState = function( nAnimationNodeId )
this.nCenterY = aState.nCenterY;
this.nScaleFactorX = aState.nScaleFactorX;
this.nScaleFactorY = aState.nScaleFactorY;
+ this.nRotationAngle = aState.nRotationAngle;
}
return bRet;
};
@@ -9136,6 +9143,7 @@ AnimatedElement.prototype.setWidth = function( nNewWidth )
this.aTMatrix = document.documentElement.createSVGMatrix()
.translate( this.nCenterX, this.nCenterY )
+ .rotate(this.nRotationAngle)
.scaleNonUniform( nScaleFactorX, this.nScaleFactorY )
.translate( -this.nBaseCenterX, -this.nBaseCenterY );
this.updateTransformAttribute();
@@ -9160,6 +9168,7 @@ AnimatedElement.prototype.setHeight = function( nNewHeight )
this.aTMatrix = document.documentElement.createSVGMatrix()
.translate( this.nCenterX, this.nCenterY )
+ .rotate(this.nRotationAngle)
.scaleNonUniform( this.nScaleFactorX, nScaleFactorY )
.translate( -this.nBaseCenterX, -this.nBaseCenterY );
this.updateTransformAttribute();
@@ -9177,6 +9186,23 @@ AnimatedElement.prototype.setOpacity = function( nValue )
this.aActiveElement.setAttribute( 'opacity', nValue );
};
+AnimatedElement.prototype.getRotationAngle = function()
+{
+ return this.nRotationAngle;
+};
+
+AnimatedElement.prototype.setRotationAngle = function( nNewRotAngle )
+{
+ this.aTMatrix = document.documentElement.createSVGMatrix()
+ .translate( this.nCenterX, this.nCenterY )
+ .rotate(nNewRotAngle)
+ .scaleNonUniform( this.nScaleFactorX, this.nScaleFactorY )
+ .translate( -this.nBaseCenterX, -this.nBaseCenterY );
+ this.updateTransformAttribute();
+
+ this.nRotationAngle = nNewRotAngle;
+};
+
AnimatedElement.prototype.getVisibility = function()
{