[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 7 commits - filter/source
Rohan Kumar
rohankanojia420 at gmail.com
Fri Apr 7 15:08:32 UTC 2017
filter/source/svg/presentation_engine.js | 722 +++++++++++++++++++++++++++----
1 file changed, 641 insertions(+), 81 deletions(-)
New commits:
commit d000db0eb4e1c6c769b8d383cf0e570ce248c682
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Sun Mar 12 23:16:30 2017 +0530
tdf#51358 Add Support for more slide transitions to Impress SVG Export
Ported the class WaterfallWipe.
Change-Id: I4856243c4b29e45f16ee780db42c2f742a6b1dc1
Reviewed-on: https://gerrit.libreoffice.org/35107
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 90e3af16263a..48cad273080f 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5170,6 +5170,7 @@ ZIGZAGWIPE_TRANSITION = 17; // 10
BARNZIGZAGWIPE_TRANSITION = 18; // 11
FANWIPE_TRANSITION = 19; // 25
SINGLESWEEPWIPE_TRANSITION = 20; // 24
+WATERFALLWIPE_TRANSITION = 21; // 34
aTransitionTypeInMap = {
'barWipe' : BARWIPE_TRANSITION,
@@ -5191,7 +5192,8 @@ aTransitionTypeInMap = {
'irisWipe' : IRISWIPE_TRANSITION,
'veeWipe' : VEEWIPE_TRANSITION,
'zigZagWipe' : ZIGZAGWIPE_TRANSITION,
- 'barnZigZagWipe' : BARNZIGZAGWIPE_TRANSITION
+ 'barnZigZagWipe' : BARNZIGZAGWIPE_TRANSITION,
+ 'waterfallWipe' : WATERFALLWIPE_TRANSITION
};
aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 'ellipseWipe',
@@ -5268,6 +5270,10 @@ CLOCKWISETOPLEFT_TRANS_SUBTYPE = 59; // 44
COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE = 60; // 45
CLOCKWISEBOTTOMRIGHT_TRANS_SUBTYPE = 61; // 46
COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE = 62; // 47
+VERTICALLEFT_TRANS_SUBTYPE = 63; // 93
+VERTICALRIGHT_TRANS_SUBTYPE = 64; // 94
+HORIZONTALLEFT_TRANS_SUBTYPE = 65; // 95
+HORIZONTALRIGHT_TRANS_SUBTYPE = 66; // 96
aTransitionSubtypeInMap = {
'default' : DEFAULT_TRANS_SUBTYPE,
@@ -5332,7 +5338,11 @@ aTransitionSubtypeInMap = {
'up' : UP_TRANS_SUBTYPE,
'right' : RIGHT_TRANS_SUBTYPE,
'diagonalBottomLeft': DIAGONALBOTTOMLEFT_TRANS_SUBTYPE,
- 'diagonalTopLeft' : DIAGONALTOPLEFT_TRANS_SUBTYPE
+ 'diagonalTopLeft' : DIAGONALTOPLEFT_TRANS_SUBTYPE,
+ 'verticalLeft' : VERTICALLEFT_TRANS_SUBTYPE,
+ 'verticalRight' : VERTICALRIGHT_TRANS_SUBTYPE,
+ 'horizontalLeft' : HORIZONTALLEFT_TRANS_SUBTYPE,
+ 'horizontalRight' : HORIZONTALRIGHT_TRANS_SUBTYPE
};
aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 'topToBottom', 'cornersIn',
@@ -5587,6 +5597,48 @@ aTransitionInfoTable[BARWIPE_TRANSITION][TOPTOBOTTOM_TRANS_SUBTYPE] =
'scaleIsotropically' : false
};
+aTransitionInfoTable[WATERFALLWIPE_TRANSITION] = {};
+aTransitionInfoTable[WATERFALLWIPE_TRANSITION][VERTICALLEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[WATERFALLWIPE_TRANSITION][VERTICALRIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[WATERFALLWIPE_TRANSITION][HORIZONTALLEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : -90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[WATERFALLWIPE_TRANSITION][HORIZONTALRIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+
aTransitionInfoTable[BOXWIPE_TRANSITION] = {};
aTransitionInfoTable[BOXWIPE_TRANSITION][TOPLEFT_TRANS_SUBTYPE] =
{
@@ -9701,6 +9753,10 @@ function createClipPolyPolygon( nType, nSubtype )
// flipOnYAxis
nSubtype == COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE ||
nSubtype == COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE );
+ case WATERFALLWIPE_TRANSITION:
+ return new WaterfallWipePath(128, // flipOnYAxis
+ nSubtype == VERTICALRIGHT_TRANS_SUBTYPE ||
+ nSubtype == HORIZONTALLEFT_TRANS_SUBTYPE);
case DISSOLVE_TRANSITION:
return new RandomWipePath( 16 * 16, false /* dissolve */ );
case VEEWIPE_TRANSITION:
@@ -10121,6 +10177,51 @@ BarnDoorWipePath.prototype.perform = function( nT ) {
return res;
}
+/** Class WaterfallWipe
+ *
+ * @param nElements
+ * Number of cells to be used
+ * @param bFlipOnYAxis
+ * Whether to flip on y-axis or not.
+ */
+function WaterfallWipePath(nElements, bFlipOnYAxis) {
+ this.bFlipOnYAxis = bFlipOnYAxis;
+
+ var sqrtElements = Math.floor(Math.sqrt(nElements));
+ var elementEdge = 1.0/sqrtElements;
+
+ var aPath = 'M '+ 0.0 + ' ' + -1.0 + ' ';
+ for(var pos = sqrtElements; pos--; ) {
+ var xPos = sqrtElements - pos - 1;
+ var yPos = pruneScaleValue( ((pos+1) * elementEdge) - 1.0);
+
+ aPath += 'L ' + pruneScaleValue(xPos * elementEdge) + ' ' + yPos + ' ';
+ aPath += 'L ' + pruneScaleValue((xPos+1)*elementEdge) + ' ' + yPos + ' ';
+ }
+ aPath += 'L ' + 1.0 + ' ' + -1.0 + ' ';
+ aPath += 'L ' + 0.0 + ' ' + -1.0 + ' ';
+ this.aBasePath = document.createElementNS( NSS['svg'], 'path');
+ this.aBasePath.setAttribute('d', aPath);
+}
+
+WaterfallWipePath.prototype.perform = function( nT ) {
+ var poly = this.aBasePath.cloneNode(true);
+ var aTransform = SVGIdentityMatrix.translate(0.0, pruneScaleValue(2.0 * nT));
+ poly.matrixTransform(aTransform);
+ var aHead = 'M ' + 0.0 + ' ' + -1.0 + ' ';
+ var aHeadPath= document.createElementNS( NSS['svg'], 'path');
+ aHeadPath.setAttribute('d', aHead);
+
+ var aTail = 'M ' + 1.0 + ' ' + -1.0 + ' ';
+ var aTailPath = document.createElementNS( NSS['svg'], 'path');
+ aTailPath.setAttribute('d', aTail);
+
+ poly.prependPath(aHeadPath);
+ poly.appendPath(aTailPath);
+
+ return this.bFlipOnYAxis ? flipOnYAxis(poly) : poly;
+}
+
/** Class Iriswipe
*
* @param unitRect
commit f56f363273808146e8fee605e07518942ffc788f
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Mon Mar 6 01:56:01 2017 +0530
tdf#51358 Support for SweepWipe transition in SVG Export
Ported the class SweepWipe
Change-Id: Ia67b50ba53900efab977a4cb284f7d1514ff8113
Reviewed-on: https://gerrit.libreoffice.org/34906
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 d1a0b95aace1..90e3af16263a 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5169,6 +5169,7 @@ VEEWIPE_TRANSITION = 16; // 8
ZIGZAGWIPE_TRANSITION = 17; // 10
BARNZIGZAGWIPE_TRANSITION = 18; // 11
FANWIPE_TRANSITION = 19; // 25
+SINGLESWEEPWIPE_TRANSITION = 20; // 24
aTransitionTypeInMap = {
'barWipe' : BARWIPE_TRANSITION,
@@ -5185,6 +5186,7 @@ aTransitionTypeInMap = {
'randomBarWipe' : RANDOMBARWIPE_TRANSITION,
'checkerBoardWipe' : CHECKERBOARDWIPE_TRANSITION,
'dissolve' : DISSOLVE_TRANSITION,
+ 'singleSweepWipe' : SINGLESWEEPWIPE_TRANSITION,
'snakeWipe' : SNAKEWIPE_TRANSITION,
'irisWipe' : IRISWIPE_TRANSITION,
'veeWipe' : VEEWIPE_TRANSITION,
@@ -5203,61 +5205,69 @@ aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 'ellipseWipe'
* C++ implementations.
*/
// Transition Subtypes
-DEFAULT_TRANS_SUBTYPE = 0;
-LEFTTORIGHT_TRANS_SUBTYPE = 1;
-TOPTOBOTTOM_TRANS_SUBTYPE = 2;
-CORNERSIN_TRANS_SUBTYPE = 3; // 11
-CORNERSOUT_TRANS_SUBTYPE = 4;
-VERTICAL_TRANS_SUBTYPE = 5;
-HORIZONTAL_TRANS_SUBTYPE = 6; // 14
-DOWN_TRANS_SUBTYPE = 7; // 19
-CIRCLE_TRANS_SUBTYPE = 8; // 27
-CLOCKWISETWELVE_TRANS_SUBTYPE = 9; // 33
-CLOCKWISETHREE_TRANS_SUBTYPE = 10;
-CLOCKWISESIX_TRANS_SUBTYPE = 11;
-CLOCKWISENINE_TRANS_SUBTYPE = 12;
-TWOBLADEVERTICAL_TRANS_SUBTYPE = 13;
-TWOBLADEHORIZONTAL_TRANS_SUBTYPE = 14;
-FOURBLADE_TRANS_SUBTYPE = 15; // 39
-FROMLEFT_TRANS_SUBTYPE = 16; // 97
-FROMTOP_TRANS_SUBTYPE = 17;
-FROMRIGHT_TRANS_SUBTYPE = 18;
-FROMBOTTOM_TRANS_SUBTYPE = 19;
-CROSSFADE_TRANS_SUBTYPE = 20;
-FADETOCOLOR_TRANS_SUBTYPE = 21;
-FADEFROMCOLOR_TRANS_SUBTYPE = 22;
-FADEOVERCOLOR_TRANS_SUBTYPE = 23;
-THREEBLADE_TRANS_SUBTYPE = 24;
-EIGHTBLADE_TRANS_SUBTYPE = 25;
-ONEBLADE_TRANS_SUBTYPE = 26; // 107
-ACROSS_TRANS_SUBTYPE = 27;
-TOPLEFTVERTICAL_TRANS_SUBTYPE = 28; // 109
-TOPLEFTHORIZONTAL_TRANS_SUBTYPE = 29; // 64
-TOPLEFTDIAGONAL_TRANS_SUBTYPE = 30; // 65
-TOPRIGHTDIAGONAL_TRANS_SUBTYPE = 31; // 66
-BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE = 32; // 67
-BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE = 33; // 68
-RECTANGLE_TRANS_SUBTYPE = 34; // 101
-DIAMOND_TRANS_SUBTYPE = 35; // 102
-TOPLEFT_TRANS_SUBTYPE = 36; // 3
-TOPRIGHT_TRANS_SUBTYPE = 37; // 4
-BOTTOMRIGHT_TRANS_SUBTYPE = 38; // 5
-BOTTOMLEFT_TRANS_SUBTYPE = 39; // 6
-TOPCENTER_TRANS_SUBTYPE = 40; // 7
-RIGHTCENTER_TRANS_SUBTYPE = 41; // 8
-BOTTOMCENTER_TRANS_SUBTYPE = 42; // 9
-LEFTCENTER_TRANS_SUBTYPE = 43; // 10
-LEFT_TRANS_SUBTYPE = 44; // 20
-UP_TRANS_SUBTYPE = 45; // 21
-RIGHT_TRANS_SUBTYPE = 46; // 22
-DIAGONALBOTTOMLEFT_TRANS_SUBTYPE = 47; // 15
-DIAGONALTOPLEFT_TRANS_SUBTYPE = 48; // 16
-CENTERTOP_TRANS_SUBTYPE = 49; // 48
-CENTERRIGHT_TRANS_SUBTYPE = 50; // 49
-TOP_TRANS_SUBTYPE = 51; // 50
-RIGHT_TRANS_SUBTYPE = 52; // 22
-BOTTOM_TRANS_SUBTYPE = 53; // 52
-LEFT_TRANS_SUBTYPE = 54; // 20
+DEFAULT_TRANS_SUBTYPE = 0;
+LEFTTORIGHT_TRANS_SUBTYPE = 1;
+TOPTOBOTTOM_TRANS_SUBTYPE = 2;
+CORNERSIN_TRANS_SUBTYPE = 3; // 11
+CORNERSOUT_TRANS_SUBTYPE = 4;
+VERTICAL_TRANS_SUBTYPE = 5;
+HORIZONTAL_TRANS_SUBTYPE = 6; // 14
+DOWN_TRANS_SUBTYPE = 7; // 19
+CIRCLE_TRANS_SUBTYPE = 8; // 27
+CLOCKWISETWELVE_TRANS_SUBTYPE = 9; // 33
+CLOCKWISETHREE_TRANS_SUBTYPE = 10;
+CLOCKWISESIX_TRANS_SUBTYPE = 11;
+CLOCKWISENINE_TRANS_SUBTYPE = 12;
+TWOBLADEVERTICAL_TRANS_SUBTYPE = 13;
+TWOBLADEHORIZONTAL_TRANS_SUBTYPE = 14;
+FOURBLADE_TRANS_SUBTYPE = 15; // 39
+FROMLEFT_TRANS_SUBTYPE = 16; // 97
+FROMTOP_TRANS_SUBTYPE = 17;
+FROMRIGHT_TRANS_SUBTYPE = 18;
+FROMBOTTOM_TRANS_SUBTYPE = 19;
+CROSSFADE_TRANS_SUBTYPE = 20;
+FADETOCOLOR_TRANS_SUBTYPE = 21;
+FADEFROMCOLOR_TRANS_SUBTYPE = 22;
+FADEOVERCOLOR_TRANS_SUBTYPE = 23;
+THREEBLADE_TRANS_SUBTYPE = 24;
+EIGHTBLADE_TRANS_SUBTYPE = 25;
+ONEBLADE_TRANS_SUBTYPE = 26; // 107
+ACROSS_TRANS_SUBTYPE = 27;
+TOPLEFTVERTICAL_TRANS_SUBTYPE = 28; // 109
+TOPLEFTHORIZONTAL_TRANS_SUBTYPE = 29; // 64
+TOPLEFTDIAGONAL_TRANS_SUBTYPE = 30; // 65
+TOPRIGHTDIAGONAL_TRANS_SUBTYPE = 31; // 66
+BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE = 32; // 67
+BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE = 33; // 68
+RECTANGLE_TRANS_SUBTYPE = 34; // 101
+DIAMOND_TRANS_SUBTYPE = 35; // 102
+TOPLEFT_TRANS_SUBTYPE = 36; // 3
+TOPRIGHT_TRANS_SUBTYPE = 37; // 4
+BOTTOMRIGHT_TRANS_SUBTYPE = 38; // 5
+BOTTOMLEFT_TRANS_SUBTYPE = 39; // 6
+TOPCENTER_TRANS_SUBTYPE = 40; // 7
+RIGHTCENTER_TRANS_SUBTYPE = 41; // 8
+BOTTOMCENTER_TRANS_SUBTYPE = 42; // 9
+LEFTCENTER_TRANS_SUBTYPE = 43; // 10
+LEFT_TRANS_SUBTYPE = 44; // 20
+UP_TRANS_SUBTYPE = 45; // 21
+RIGHT_TRANS_SUBTYPE = 46; // 22
+DIAGONALBOTTOMLEFT_TRANS_SUBTYPE = 47; // 15
+DIAGONALTOPLEFT_TRANS_SUBTYPE = 48; // 16
+CENTERTOP_TRANS_SUBTYPE = 49; // 48
+CENTERRIGHT_TRANS_SUBTYPE = 50; // 49
+TOP_TRANS_SUBTYPE = 51; // 50
+RIGHT_TRANS_SUBTYPE = 52; // 22
+BOTTOM_TRANS_SUBTYPE = 53; // 52
+LEFT_TRANS_SUBTYPE = 54; // 20
+CLOCKWISETOP_TRANS_SUBTYPE = 55; // 40
+CLOCKWISERIGHT_TRANS_SUBTYPE = 56; // 41
+CLOCKWISEBOTTOM_TRANS_SUBTYPE = 57; // 42
+CLOCKWISELEFT_TRANS_SUBTYPE = 58; // 43
+CLOCKWISETOPLEFT_TRANS_SUBTYPE = 59; // 44
+COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE = 60; // 45
+CLOCKWISEBOTTOMRIGHT_TRANS_SUBTYPE = 61; // 46
+COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE = 62; // 47
aTransitionSubtypeInMap = {
'default' : DEFAULT_TRANS_SUBTYPE,
@@ -5279,6 +5289,14 @@ aTransitionSubtypeInMap = {
'clockwiseThree' : CLOCKWISETHREE_TRANS_SUBTYPE,
'clockwiseSix' : CLOCKWISESIX_TRANS_SUBTYPE,
'clockwiseNine' : CLOCKWISENINE_TRANS_SUBTYPE,
+ 'clockwiseRight' : CLOCKWISERIGHT_TRANS_SUBTYPE,
+ 'clockwiseTop' : CLOCKWISETOP_TRANS_SUBTYPE,
+ 'clockwiseBottom' : CLOCKWISEBOTTOM_TRANS_SUBTYPE,
+ 'clockwiseLeft' : CLOCKWISELEFT_TRANS_SUBTYPE,
+ 'clockwiseTopLeft' : CLOCKWISETOPLEFT_TRANS_SUBTYPE,
+ 'counterClockwiseBottomLeft' : COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE,
+ 'clockwiseBottomRight' : CLOCKWISEBOTTOMRIGHT_TRANS_SUBTYPE,
+ 'counterClockwiseTopRight' : COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE,
'twoBladeVertical' : TWOBLADEVERTICAL_TRANS_SUBTYPE,
'twoBladeHorizontal': TWOBLADEHORIZONTAL_TRANS_SUBTYPE,
'fourBlade' : FOURBLADE_TRANS_SUBTYPE,
@@ -5884,6 +5902,89 @@ aTransitionInfoTable[PUSHWIPE_TRANSITION][FROMBOTTOM_TRANS_SUBTYPE] =
'scaleIsotropically' : false
};
+
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION] = {};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISETOP_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISERIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISEBOTTOM_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 180.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISELEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 270.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISETOPLEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 180.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISEBOTTOMRIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 180.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+
aTransitionInfoTable[SLIDEWIPE_TRANSITION] = {};
aTransitionInfoTable[SLIDEWIPE_TRANSITION][FROMLEFT_TRANS_SUBTYPE] =
aTransitionInfoTable[SLIDEWIPE_TRANSITION][FROMTOP_TRANS_SUBTYPE] =
@@ -9586,6 +9687,20 @@ function createClipPolyPolygon( nType, nSubtype )
}
case BARNDOORWIPE_TRANSITION:
return new BarnDoorWipePath(true);
+ case SINGLESWEEPWIPE_TRANSITION:
+ return new SweepWipePath(
+ // center
+ nSubtype == CLOCKWISETOP_TRANS_SUBTYPE ||
+ nSubtype == CLOCKWISERIGHT_TRANS_SUBTYPE ||
+ nSubtype == CLOCKWISEBOTTOM_TRANS_SUBTYPE ||
+ nSubtype == CLOCKWISELEFT_TRANS_SUBTYPE,
+ // single
+ true,
+ // oppositeVertical
+ false,
+ // flipOnYAxis
+ nSubtype == COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE ||
+ nSubtype == COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE );
case DISSOLVE_TRANSITION:
return new RandomWipePath( 16 * 16, false /* dissolve */ );
case VEEWIPE_TRANSITION:
@@ -9707,6 +9822,51 @@ BoxWipePath.prototype.perform = function( nT ) {
return aPath;
}
+/* Class SweepWipePath
+ *
+ *
+ */
+function SweepWipePath(bCenter, bSingle, bOppositeVertical, bFlipOnYAxis) {
+ this.bCenter = bCenter;
+ this.bSingle = bSingle;
+ this.bOppositeVertical = bOppositeVertical;
+ this.bFlipOnYAxis = bFlipOnYAxis;
+ this.aBasePath = createUnitSquarePath();
+}
+
+SweepWipePath.prototype.perform = function( nT ) {
+ nT /= 2.0;
+ if(!this.bCenter)
+ nT /= 2.0;
+ if(!this.bSingle && !this.bOppositeVertical)
+ nT /= 2.0;
+
+ var aBasePath = PinWheelWipePath.calcCenteredClock( nT + 0.25, 1.0 );
+ var aTransform;
+
+ if(this.bCenter) {
+ aTransform = SVGIdentityMatrix.translate(0.5, 0.0);
+ aBasePath.matrixTransform(aTransform);
+ }
+ var res = aBasePath;
+
+ if(!this.bSingle) {
+ if(this.bOppositeVertical) {
+ aTransform = SVGIdentityMatrix.scale(1.0, -1.0);
+ aTransform.translate(0.0, 1.0);
+ poly.matrixTransform(aTransform);
+ poly.changeOrientation();
+ }
+ else {
+ aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
+ aTransform.rotate(Math.PI);
+ aTransform.translate(0.5, 0.5);
+ poly.matrixTransform(aTransform);
+ }
+ res.appendPath(poly);
+ }
+ return this.bFlipOnYAxis ? flipOnYAxis(res) : res;
+}
/** Class FourBoxWipePath
* This class handles a path made up by four squares and is utilized for
commit b2faa253f8fce00c9f15cf58545353b481603ca7
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Sat Feb 4 03:15:06 2017 +0530
tdf#51358 Add Support for FanWipe class
Ported the class FanWipe In SVG engine.
Change-Id: I8a067f2df32968bb00d5b3adc020bc9ee8296f33
Reviewed-on: https://gerrit.libreoffice.org/33910
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 35f4b5a894c4..d1a0b95aace1 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5168,6 +5168,7 @@ BARNDOORWIPE_TRANSITION = 15; // 4
VEEWIPE_TRANSITION = 16; // 8
ZIGZAGWIPE_TRANSITION = 17; // 10
BARNZIGZAGWIPE_TRANSITION = 18; // 11
+FANWIPE_TRANSITION = 19; // 25
aTransitionTypeInMap = {
'barWipe' : BARWIPE_TRANSITION,
@@ -5180,6 +5181,7 @@ aTransitionTypeInMap = {
'pushWipe' : PUSHWIPE_TRANSITION,
'slideWipe' : SLIDEWIPE_TRANSITION,
'fade' : FADE_TRANSITION,
+ 'fanWipe' : FANWIPE_TRANSITION,
'randomBarWipe' : RANDOMBARWIPE_TRANSITION,
'checkerBoardWipe' : CHECKERBOARDWIPE_TRANSITION,
'dissolve' : DISSOLVE_TRANSITION,
@@ -5250,6 +5252,12 @@ UP_TRANS_SUBTYPE = 45; // 21
RIGHT_TRANS_SUBTYPE = 46; // 22
DIAGONALBOTTOMLEFT_TRANS_SUBTYPE = 47; // 15
DIAGONALTOPLEFT_TRANS_SUBTYPE = 48; // 16
+CENTERTOP_TRANS_SUBTYPE = 49; // 48
+CENTERRIGHT_TRANS_SUBTYPE = 50; // 49
+TOP_TRANS_SUBTYPE = 51; // 50
+RIGHT_TRANS_SUBTYPE = 52; // 22
+BOTTOM_TRANS_SUBTYPE = 53; // 52
+LEFT_TRANS_SUBTYPE = 54; // 20
aTransitionSubtypeInMap = {
'default' : DEFAULT_TRANS_SUBTYPE,
@@ -5258,6 +5266,12 @@ aTransitionSubtypeInMap = {
'cornersIn' : CORNERSIN_TRANS_SUBTYPE,
'cornersOut' : CORNERSOUT_TRANS_SUBTYPE,
'vertical' : VERTICAL_TRANS_SUBTYPE,
+ 'centerTop' : CENTERTOP_TRANS_SUBTYPE,
+ 'centerRight' : CENTERRIGHT_TRANS_SUBTYPE,
+ 'top' : TOP_TRANS_SUBTYPE,
+ 'right' : RIGHT_TRANS_SUBTYPE,
+ 'bottom' : BOTTOM_TRANS_SUBTYPE,
+ 'left' : LEFT_TRANS_SUBTYPE,
'horizontal' : HORIZONTAL_TRANS_SUBTYPE,
'down' : DOWN_TRANS_SUBTYPE,
'circle' : CIRCLE_TRANS_SUBTYPE,
@@ -5766,6 +5780,69 @@ aTransitionInfoTable[VEEWIPE_TRANSITION][RIGHT_TRANS_SUBTYPE] =
'scaleIsotropically' : false
};
+aTransitionInfoTable[FANWIPE_TRANSITION] = {};
+aTransitionInfoTable[FANWIPE_TRANSITION][CENTERTOP_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][CENTERRIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_X,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][TOP_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 180.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][RIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : -90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_X,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][BOTTOM_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 180.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][LEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_X,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+
+
aTransitionInfoTable[PINWHEELWIPE_TRANSITION] = {};
aTransitionInfoTable[PINWHEELWIPE_TRANSITION][ONEBLADE_TRANS_SUBTYPE] =
aTransitionInfoTable[PINWHEELWIPE_TRANSITION][TWOBLADEVERTICAL_TRANS_SUBTYPE] =
@@ -9455,6 +9532,9 @@ function createClipPolyPolygon( nType, nSubtype )
nSubtype == BOTTOMCENTER_TRANS_SUBTYPE );
case ELLIPSEWIPE_TRANSITION:
return new EllipseWipePath( nSubtype );
+ case FANWIPE_TRANSITION:
+ return new FanWipePath(nSubtype == CENTERTOP_TRANS_SUBTYPE ||
+ nSubtype == CENTERRIGHT_TRANS_SUBTYPE, true, false);
case PINWHEELWIPE_TRANSITION:
var nBlades;
switch( nSubtype )
@@ -9732,6 +9812,41 @@ EllipseWipePath.prototype.perform = function( nT )
return aEllipse;
};
+/*
+ * Class FanWipePath
+ *
+ */
+function FanWipePath(bIsCenter, bIsSingle, bIsFanIn) {
+ this.bCenter = bIsCenter;
+ this.bSingle = bIsSingle;
+ this.bFanIn = bIsFanIn;
+ this.aBasePath = createUnitSquarePath();
+}
+
+FanWipePath.prototype.perform = function( nT ) {
+ var res = this.aBasePath.cloneNode(true);
+ var poly = PinWheelWipePath.calcCenteredClock(
+ nT / ((this.bCenter && this.bSingle) ? 2.0 : 4.0), 1.0);
+ res.appendPath(poly);
+ // flip on y-axis
+ var aTransform = SVGIdentityMatrix.flipY();
+ aTransform = aTransform.scaleNonUniform(-1.0, 1.0);
+ poly.matrixTransform(aTransform);
+ res.appendPath(poly);
+
+ if(this.bCenter) {
+ aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 0.5).translate(0.5, 0.5);
+ res.matrixTransform(aTransform);
+
+ if(!this.bSingle)
+ res.appendPath(flipOnXAxis(res));
+ }
+ else {
+ aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 1.0).translate(0.5, 1.0);
+ res.matrixTransform(aTransform);
+ }
+ return res;
+}
/**
* Class ClockWipePath
commit 4840c011f8ee043f7910f94b4ed70fde905ec471
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Tue Jan 31 18:52:58 2017 +0530
tdf#51358 Support for ZigZag-Wipe transition animation in SVG support
Ported classes ZigZagWipe and BarnZigZagWipe
Change-Id: Ib15929c24dc952944ac4de5b71c541cdd99affcc
Reviewed-on: https://gerrit.libreoffice.org/33763
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 292677d797ce..35f4b5a894c4 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5166,6 +5166,8 @@ SNAKEWIPE_TRANSITION = 13; // 30
IRISWIPE_TRANSITION = 14; // 12
BARNDOORWIPE_TRANSITION = 15; // 4
VEEWIPE_TRANSITION = 16; // 8
+ZIGZAGWIPE_TRANSITION = 17; // 10
+BARNZIGZAGWIPE_TRANSITION = 18; // 11
aTransitionTypeInMap = {
'barWipe' : BARWIPE_TRANSITION,
@@ -5183,7 +5185,9 @@ aTransitionTypeInMap = {
'dissolve' : DISSOLVE_TRANSITION,
'snakeWipe' : SNAKEWIPE_TRANSITION,
'irisWipe' : IRISWIPE_TRANSITION,
- 'veeWipe' : VEEWIPE_TRANSITION
+ 'veeWipe' : VEEWIPE_TRANSITION,
+ 'zigZagWipe' : ZIGZAGWIPE_TRANSITION,
+ 'barnZigZagWipe' : BARNZIGZAGWIPE_TRANSITION
};
aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 'ellipseWipe',
@@ -5485,6 +5489,50 @@ aTransitionInfoTable[IRISWIPE_TRANSITION][DIAMOND_TRANS_SUBTYPE] =
'scaleIsotropically': false
};
+aTransitionInfoTable[ZIGZAGWIPE_TRANSITION] = {};
+aTransitionInfoTable[ZIGZAGWIPE_TRANSITION][LEFTTORIGHT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_X,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[ZIGZAGWIPE_TRANSITION][TOPTOBOTTOM_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+
+aTransitionInfoTable[BARNZIGZAGWIPE_TRANSITION] = {};
+aTransitionInfoTable[BARNZIGZAGWIPE_TRANSITION][VERTICAL_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 0.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_IGNORE,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+aTransitionInfoTable[BARNZIGZAGWIPE_TRANSITION][HORIZONTAL_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle' : 90.0,
+ 'scaleX' : 1.0,
+ 'scaleY' : 1.0,
+ 'reverseMethod' : REVERSEMETHOD_IGNORE,
+ 'outInvertsSweep' : true,
+ 'scaleIsotropically' : false
+};
+
aTransitionInfoTable[BARWIPE_TRANSITION] = {};
aTransitionInfoTable[BARWIPE_TRANSITION][LEFTTORIGHT_TRANS_SUBTYPE] =
{
@@ -9441,6 +9489,10 @@ function createClipPolyPolygon( nType, nSubtype )
return new RandomWipePath( 128, true /* bars */ );
case CHECKERBOARDWIPE_TRANSITION:
return new CheckerBoardWipePath( 10 );
+ case ZIGZAGWIPE_TRANSITION:
+ return new ZigZagWipePath( 5 );
+ case BARNZIGZAGWIPE_TRANSITION:
+ return new BarnZigZagWipePath( 5 );
case IRISWIPE_TRANSITION:
switch(nSubtype)
{
@@ -9821,6 +9873,64 @@ IrisWipePath.prototype.perform = function( nT ) {
return aPath;
}
+/**
+ * Class ZigZagWipePath
+ *
+ * @param nZigs
+ *
+ */
+function ZigZagWipePath(nZigs) {
+ this.zigEdge = 1.0/nZigs;
+ const d = this.zigEdge;
+ const d2 = (d / 2.0);
+ this.aBasePath = 'M ' + (-1.0 - d) + ' ' + -d + ' ';
+ this.aBasePath += 'L ' + (-1.0 - d) + ' ' + (1.0 + d) + ' ';
+ this.aBasePath += 'L ' + -d + ' ' + (1.0 + d) + ' ';
+
+ for(var pos = (nZigs + 2); pos--; ) {
+ this.aBasePath += 'L ' + 0.0 + ' ' + ((pos - 1) * d + d2) + ' ';
+ this.aBasePath += 'L ' + -d + ' ' + (pos - 1) * d + ' ';
+ }
+ this.aBasePath += 'L ' + (-1.0 - d) + ' ' + -d + ' ';
+}
+
+ZigZagWipePath.prototype.perform = function( nT ) {
+ var res = document.createElementNS( NSS['svg'], 'path');
+ res.setAttribute('d', this.aBasePath);
+ res.matrixTransform(SVGIdentityMatrix.translate((1.0 + this.zigEdge) * nT, 0.0));
+ return res;
+}
+
+/*
+ * Class BarnZigZagWipePath
+ *
+ * @param nZigs
+ *
+ */
+function BarnZigZagWipePath( nZigs ) { ZigZagWipePath.call(this, nZigs); }
+
+BarnZigZagWipePath.prototype = Object.create(ZigZagWipePath);
+
+BarnZigZagWipePath.prototype.perform = function( nT ) {
+ var res = createEmptyPath();
+ var poly = document.createElementNS( NSS['svg'], 'path');
+ var aTransform = SVGIdentityMatrix.translate(
+ ((1.0 + this.zigEdge) * (1.0 - nT)) / 2.0, 0.0);
+ poly.setAttribute('d', this.aBasePath);
+ poly.changeOrientation();
+ poly.matrixTransform(aTransform);
+ res.appendPath(poly);
+
+ aTransform = SVGIdentityMatrix.scale(-1.0, 1.0);
+ aTransform.translate(1.0, this.zigEdge / 2.0);
+ poly = document.createElementNS( NSS['svg'], 'path');
+ poly.setAttribute('d', this.aBasePath);
+ poly.matrixTransform(aTransform);
+ res.appendPath(poly);
+
+ return res;
+}
+
/** Class CheckerBoardWipePath
*
* @param unitsPerEdge
commit c68cc00c39b68a299f7d6d2445f3780d7290e432
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Tue Mar 14 20:00:16 2017 +0530
Fixed my mistake: fix flipOnYAxis for SVGPathElement
Fix flipOnYAxis() method which was the cause of some SnakeWipePath
transition subtypes not working.
Change-Id: I1bea5bdddf6c6312384f59d8614a0a2bc1a6e3ba
Reviewed-on: https://gerrit.libreoffice.org/35191
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-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 eaee72509a51..292677d797ce 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4558,12 +4558,22 @@ SVGPathElement.prototype.appendPath = function( aPath )
this.setAttribute( 'd', sPathData );
};
+/** flipOnYAxis
+ * Flips the SVG Path element along y-axis.
+ *
+ * @param aPath
+ * An object of type SVGPathElement to be flipped.
+ */
function flipOnYAxis( aPath )
{
- var aMatrix = SVGIdentityMatrix.flipY().scaleNonUniform(-1, 1);
- aPath.matrixTransform(aMatrix);
- return aPath;
+ var aPolyPath = aPath.cloneNode(true);
+ var aTransform = document.documentElement.createSVGMatrix();
+ aTransform.a = -1;
+ aTransform.e = 1;
+ aPolyPath.matrixTransform(aTransform);
+ return aPolyPath;
}
+
/** SVGPathElement.matrixTransform
* Apply the transformation defined by the passed matrix to the referenced
* svg <path> element.
commit 3cced87438236e1ced6eb60cd4f40ac92b31c663
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Thu Jan 19 23:06:09 2017 +0530
tdf#51358 Support for BarnDoorWipe transition animation in SVG support
ported the class BarnDoorWipe
Change-Id: I10c98cf575c76bb0c96a9622721d1ab368941dca
Reviewed-on: https://gerrit.libreoffice.org/33323
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 3d5731eed950..eaee72509a51 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5154,11 +5154,13 @@ CHECKERBOARDWIPE_TRANSITION = 11; // 39
DISSOLVE_TRANSITION = 12; // 40
SNAKEWIPE_TRANSITION = 13; // 30
IRISWIPE_TRANSITION = 14; // 12
-VEEWIPE_TRANSITION = 17; // 8
+BARNDOORWIPE_TRANSITION = 15; // 4
+VEEWIPE_TRANSITION = 16; // 8
aTransitionTypeInMap = {
'barWipe' : BARWIPE_TRANSITION,
'boxWipe' : BOXWIPE_TRANSITION,
+ 'barnDoorWipe' : BARNDOORWIPE_TRANSITION,
'fourBoxWipe' : FOURBOXWIPE_TRANSITION,
'ellipseWipe' : ELLIPSEWIPE_TRANSITION,
'clockWipe' : CLOCKWIPE_TRANSITION,
@@ -5221,10 +5223,10 @@ BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE = 32; // 67
BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE = 33; // 68
RECTANGLE_TRANS_SUBTYPE = 34; // 101
DIAMOND_TRANS_SUBTYPE = 35; // 102
-TOPLEFT_TRANS_SUBTYPE = 36 // 3
-TOPRIGHT_TRANS_SUBTYPE = 37 // 4
-BOTTOMRIGHT_TRANS_SUBTYPE = 38 // 5
-BOTTOMLEFT_TRANS_SUBTYPE = 39 // 6
+TOPLEFT_TRANS_SUBTYPE = 36; // 3
+TOPRIGHT_TRANS_SUBTYPE = 37; // 4
+BOTTOMRIGHT_TRANS_SUBTYPE = 38; // 5
+BOTTOMLEFT_TRANS_SUBTYPE = 39; // 6
TOPCENTER_TRANS_SUBTYPE = 40; // 7
RIGHTCENTER_TRANS_SUBTYPE = 41; // 8
BOTTOMCENTER_TRANS_SUBTYPE = 42; // 9
@@ -5232,6 +5234,8 @@ LEFTCENTER_TRANS_SUBTYPE = 43; // 10
LEFT_TRANS_SUBTYPE = 44; // 20
UP_TRANS_SUBTYPE = 45; // 21
RIGHT_TRANS_SUBTYPE = 46; // 22
+DIAGONALBOTTOMLEFT_TRANS_SUBTYPE = 47; // 15
+DIAGONALTOPLEFT_TRANS_SUBTYPE = 48; // 16
aTransitionSubtypeInMap = {
'default' : DEFAULT_TRANS_SUBTYPE,
@@ -5280,7 +5284,9 @@ aTransitionSubtypeInMap = {
'leftCenter' : LEFTCENTER_TRANS_SUBTYPE,
'left' : LEFT_TRANS_SUBTYPE,
'up' : UP_TRANS_SUBTYPE,
- 'right' : RIGHT_TRANS_SUBTYPE
+ 'right' : RIGHT_TRANS_SUBTYPE,
+ 'diagonalBottomLeft': DIAGONALBOTTOMLEFT_TRANS_SUBTYPE,
+ 'diagonalTopLeft' : DIAGONALTOPLEFT_TRANS_SUBTYPE
};
aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 'topToBottom', 'cornersIn',
@@ -5402,6 +5408,48 @@ aTransitionInfoTable[SNAKEWIPE_TRANSITION][BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE] =
'reverseMethod' : REVERSEMETHOD_ROTATE_180,
'outInvertSweep' : true,
'scaleIsotropically' : false
+}
+
+aTransitionInfoTable[BARNDOORWIPE_TRANSITION] = {};
+aTransitionInfoTable[BARNDOORWIPE_TRANSITION][VERTICAL_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle': 0.0,
+ 'scaleX': 1.0,
+ 'scaleY': 1.0,
+ 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep': true,
+ 'scaleIsotropically': false
+};
+aTransitionInfoTable[BARNDOORWIPE_TRANSITION][HORIZONTAL_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle': 90.0,
+ 'scaleX': 1.0,
+ 'scaleY': 1.0,
+ 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep': true,
+ 'scaleIsotropically': false
+};
+aTransitionInfoTable[BARNDOORWIPE_TRANSITION][DIAGONALBOTTOMLEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle': 45.0,
+ 'scaleX': Math.SQRT2,
+ 'scaleY': Math.SQRT2,
+ 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep': true,
+ 'scaleIsotropically': false
+};
+aTransitionInfoTable[BARNDOORWIPE_TRANSITION][DIAGONALTOPLEFT_TRANS_SUBTYPE] =
+{
+ 'class' : TRANSITION_CLIP_POLYPOLYGON,
+ 'rotationAngle': -45.0,
+ 'scaleX': Math.SQRT2,
+ 'scaleY': Math.SQRT2,
+ 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
+ 'outInvertsSweep': true,
+ 'scaleIsotropically': false
};
aTransitionInfoTable[IRISWIPE_TRANSITION] = {};
@@ -9394,6 +9442,8 @@ function createClipPolyPolygon( nType, nSubtype )
log( 'createClipPolyPolygon: unknown subtype: ' + nSubtype );
return null;
}
+ case BARNDOORWIPE_TRANSITION:
+ return new BarnDoorWipePath(true);
case DISSOLVE_TRANSITION:
return new RandomWipePath( 16 * 16, false /* dissolve */ );
case VEEWIPE_TRANSITION:
@@ -9707,6 +9757,33 @@ PinWheelWipePath.prototype.perform = function( nT )
return aPolyPath;
};
+/** Class BarnDoorWipe
+ *
+ * @param doubled
+ */
+function BarnDoorWipePath(doubled) {
+ this.aBasePath = createUnitSquarePath();
+ this.doubled = doubled;
+}
+
+BarnDoorWipePath.prototype.perform = function( nT ) {
+ if(this.doubled)
+ nT /= 2.0;
+ var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
+ aTransform = aTransform.scaleNonUniform(pruneScaleValue(nT), 1.0).translate(0.5, 0.5);
+ var aPath = this.aBasePath.cloneNode(true);
+ aPath.matrixTransform(aTransform);
+ var res = aPath;
+
+ if(this.doubled) {
+ aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
+ aTransform = aTransform.rotate(Math.PI / 2).translate(0.5, 0.5);
+ aPath.matrixTransform(aTransform);
+ res.appendPath(aPath);
+ }
+ return res;
+}
+
/** Class Iriswipe
*
* @param unitRect
commit 7a0669e8b104a3b4ab22a582ff58742a5bae5892
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Sun Feb 5 01:33:43 2017 +0530
Fix flip issue in Snake animation subtype
Fix flipOnYAxis function, alongwith minor tweaks.
Change-Id: If8958de9eb651a15f86963f2e40eb364011ce41f
Reviewed-on: https://gerrit.libreoffice.org/33918
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 2bd2de006e9d..3d5731eed950 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4560,7 +4560,7 @@ SVGPathElement.prototype.appendPath = function( aPath )
function flipOnYAxis( aPath )
{
- var aMatrix = SVGIdentityMatrix.scaleNonUniform(-1, 1).translate(1, 0);
+ var aMatrix = SVGIdentityMatrix.flipY().scaleNonUniform(-1, 1);
aPath.matrixTransform(aMatrix);
return aPath;
}
@@ -9860,24 +9860,18 @@ function SnakeWipePath(nElements, bDiagonal, bflipOnYAxis)
SnakeWipePath.prototype.calcSnake = function(t)
{
var aPolyPath = createEmptyPath();
- var res = this.aBasePath.cloneNode(true);
- var area = (t * this.sqrtElements * this.sqrtElements);
- var line_ = Math.floor(area / this.sqrtElements);
- var line = pruneScaleValue(line_ / this.sqrtElements);
- var col = pruneScaleValue((area - (line_ * this.sqrtElements)) / this.sqrtElements);
- var aTransform;
+ const area = (t * this.sqrtElements * this.sqrtElements);
+ const line_ = Math.floor(area) / this.sqrtElements;
+ const line = pruneScaleValue(line_ / this.sqrtElements);
+ const col = pruneScaleValue((area - (line_ * this.sqrtElements)) / this.sqrtElements);
if(line != 0) {
- var aPoint = document.documentElement.createSVGPoint();
- var aPath = 'M '+ aPoint.x + ' ' + aPoint.y + ' ';
- aPoint.y = line;
- aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
- aPoint.x = 1.0;
- aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
- aPoint.y = 0.0;
- aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+ let aPath = 'M '+ 0.0 + ' ' + 0.0 + ' ';
+ aPath += 'L ' + 0.0 + ' ' + line + ' ';
+ aPath += 'L ' + 1.0 + ' ' + line + ' ';
+ aPath += 'L ' + 1.0 + ' ' + 0.0 + ' ';
aPath += 'L 0 0 ';
- var poly = document.createElementNS( NSS['svg'], 'path');
+ let poly = document.createElementNS( NSS['svg'], 'path');
poly.setAttribute('d', aPath);
aPolyPath.appendPath(poly);
}
@@ -9887,19 +9881,12 @@ SnakeWipePath.prototype.calcSnake = function(t)
// odd line: => right to left
offset = (1.0 - col);
}
- var aPoint = document.documentElement.createSVGPoint();
- aPoint.x = offset;
- aPoint.y = line;
- var aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
- aPoint.y += this.elementEdge;
- aPath += 'L '+ aPoint.x + ' ' + aPoint.y + ' ';
- aPoint.x = offset + col;
- aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
- aPoint.y = line;
- aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
- aPoint.x = offset;
- aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
- var poly = document.createElementNS( NSS['svg'], 'path');
+ let aPath = 'M ' + offset + ' ' + line + ' ';
+ aPath += 'L '+ offset + ' ' + (line + this.elementEdge) + ' ';
+ aPath += 'L ' + (offset+col) + ' ' + (line + this.elementEdge) + ' ';
+ aPath += 'L ' + (offset+col) + ' ' + line + ' ';
+ aPath += 'L ' + offset + ' ' + line + ' ';
+ let poly = document.createElementNS( NSS['svg'], 'path');
poly.setAttribute('d', aPath);
aPolyPath.appendPath(poly);
}
More information about the Libreoffice-commits
mailing list