filter/source/svg/presentation_engine.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
New commits: commit 14272dde34e2d4bf0ee31133a36145377ce74cb5 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Tue Jun 21 11:07:42 2016 +0200 bccu#1870 - added support for rotate attribute Change-Id: I0b29fa65171c12c25122176af3c9b4e7a9c0826f Reviewed-on: https://gerrit.libreoffice.org/26835 Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> Tested-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index c9222f5..4d7d6b2 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() { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits