Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


Hi Harsh Choudhary,

to your other question - managed to get your below change to affect
the svg export meanwhile? If not, a description of what you tried
would be good.

As for the patch, comments inline:
From 50042ccd574717e679fadc6028b28e6104d3c359 Mon Sep 17 00:00:00 2001
From: Harsh <harsh@harsh-kubuntu.(none)>

Please fix your git setup (user and email address)

Date: Tue, 4 Feb 2014 20:47:50 +0530
Subject: [PATCH] pres

This needs at least a minimal description of what this patch does.

---
 filter/source/svg/presentation_engine.js |  119 ++++++++++++++++++++++++++++--
 1 file changed, 111 insertions(+), 8 deletions(-)

diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
index c77ff1d..98d1245 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4100,10 +4100,11 @@ FOURBOXWIPE_TRANSITION      = 3;
 ELLIPSEWIPE_TRANSITION      = 4; // 17
 CLOCKWIPE_TRANSITION        = 5; // 22
 PINWHEELWIPE_TRANSITION     = 6;  // 23
-PUSHWIPE_TRANSITION         = 7; // 35
-SLIDEWIPE_TRANSITION        = 8; // 36
-FADE_TRANSITION             = 9; // 37
-CHECKERBOARDWIPE_TRANSITION = 10; // 39
+WATERFALLWIPE_TRANSITION    = 7; //34
+PUSHWIPE_TRANSITION         = 8; // 35
+SLIDEWIPE_TRANSITION        = 9; // 36
+FADE_TRANSITION             = 10; // 37
+CHECKERBOARDWIPE_TRANSITION = 11; // 39
 
 aTransitionTypeInMap = {
     'barWipe'           : BARWIPE_TRANSITION,
@@ -4112,6 +4113,7 @@ aTransitionTypeInMap = {
     'ellipseWipe'       : ELLIPSEWIPE_TRANSITION,
     'clockWipe'         : CLOCKWIPE_TRANSITION,
     'pinWheelWipe'      : PINWHEELWIPE_TRANSITION,
+    'waterfallWipe'     : WATERFALLWIPE_TRANSITION
     'pushWipe'          : PUSHWIPE_TRANSITION,
     'slideWipe'         : SLIDEWIPE_TRANSITION,
     'fade'              : FADE_TRANSITION,
@@ -4119,7 +4121,7 @@ aTransitionTypeInMap = {
 };
 
 aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 'ellipseWipe',
-                          'clockWipe', 'pinWheelWipe', 'pushWipe', 'slideWipe',
+                          'clockWipe', 'pinWheelWipe', 'waterfallWipe', 'pushWipe', 'slideWipe',
                           'fade', 'checkerBoardWipe' ];
 
 
@@ -4140,7 +4142,9 @@ CLOCKWISENINE_TRANS_SUBTYPE         = 12;
 TWOBLADEVERTICAL_TRANS_SUBTYPE      = 13;
 TWOBLADEHORIZONTAL_TRANS_SUBTYPE    = 14;
 FOURBLADE_TRANS_SUBTYPE             = 15; // 39
-FROMLEFT_TRANS_SUBTYPE              = 16; // 97
+HORIZONTALLEFT_TRANS_SUBTYPE        = 30; //95
+HORIZONTALRIGHT_TRANS_SUBTYPE       = 31;
+FROMLEFT_TRANS_SUBTYPE              = 16;
 FROMTOP_TRANS_SUBTYPE               = 17;
 FROMRIGHT_TRANS_SUBTYPE             = 18;
 FROMBOTTOM_TRANS_SUBTYPE            = 19;
@@ -4151,7 +4155,7 @@ FADEOVERCOLOR_TRANS_SUBTYPE         = 23;
 THREEBLADE_TRANS_SUBTYPE            = 24;
 EIGHTBLADE_TRANS_SUBTYPE            = 25;
 ONEBLADE_TRANS_SUBTYPE              = 26; // 107
-ACROSS_TRANS_SUBTYPE                = 27;
+ACROSS_TRANS_SUBTYPE                = 27; 
 
redundant whitespace change

 aTransitionSubtypeInMap = {
     'leftToRight'       : LEFTTORIGHT_TRANS_SUBTYPE,
@@ -4169,6 +4173,8 @@ aTransitionSubtypeInMap = {
     'twoBladeVertical'  : TWOBLADEVERTICAL_TRANS_SUBTYPE,
     'twoBladeHorizontal': TWOBLADEHORIZONTAL_TRANS_SUBTYPE,
     'fourBlade'         : FOURBLADE_TRANS_SUBTYPE,
+    'horizontalLeft'    : HORIZONTALLEFT_TRANS_SUBTYPE,
+    'horizontalRight'   : HORIZONTALRIGHT_TRANS_SUBTYPE,
     'fromLeft'          : FROMLEFT_TRANS_SUBTYPE,
     'fromTop'           : FROMTOP_TRANS_SUBTYPE,
     'fromRight'         : FROMRIGHT_TRANS_SUBTYPE,
@@ -4187,7 +4193,7 @@ aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 'topToBottom', 
'cornersIn
                              'cornersOut', 'vertical', 'horizontal', 'down', 'circle',
                              'clockwiseTwelve', 'clockwiseThree', 'clockwiseSix',
                              'clockwiseNine', 'twoBladeVertical', 'twoBladeHorizontal',
-                             'fourBlade', 'fromLeft', 'fromTop', 'fromRight',
+                             'fourBlade', 'horizontalLeft', 'horizontalRight', 'fromLeft', 
'fromTop', 'fromRight',
                              'fromBottom', 'crossfade', 'fadeToColor', 'fadeFromColor',
                              'fadeOverColor', 'threeBlade', 'eightBlade', 'oneBlade',
                              'across' ];
@@ -4378,6 +4384,28 @@ 
aTransitionInfoTable[PINWHEELWIPE_TRANSITION][TWOBLADEHORIZONTAL_TRANS_SUBTYPE]
     'scaleIsotropically' : true
 };
 
+aTransitionInfoTable[WATERFALLWIPE_TRANSITION] = {};
+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[PUSHWIPE_TRANSITION] = {};
 aTransitionInfoTable[PUSHWIPE_TRANSITION][FROMLEFT_TRANS_SUBTYPE] =
 aTransitionInfoTable[PUSHWIPE_TRANSITION][FROMTOP_TRANS_SUBTYPE] =
@@ -7997,6 +8025,8 @@ function createClipPolyPolygon( nType, nSubtype )
             return new PinWheelWipePath( nBlades );
         case CHECKERBOARDWIPE_TRANSITION:
             return new CheckerBoardWipePath( 10 );
+        case WATERFALLWIPE_TRANSITION:
+            return new waterfallWipePath(nSubtype);/////////////////
     }
 }
 
@@ -8306,7 +8336,80 @@ CheckerBoardWipePath.prototype.perform = function( nT )
     return aPolyPath;
 };
 
+/ ------------------------------------------------------------------------------------------ //
+/** Class WaterfallWipePath
+ *  This class handles a parametric poly-path that is used for performing
+ *  a waterfallWipe transition.
+ *
+ *  @param nBlades
+ *      Number of blades generated by the transition.
+ */
+function WaterfallWipePath( nElements, flipOnYAxis )
+{
+    var sqrtElements = Math.sqrt(nElements);
+    

Here, and at other places - please avoid trailing whitespace.

+    var elementEdge = (1 / sqrtElements);
+    
+    this.flipOnYAxis = flipOnYAxis;
+    
+    var  m_waterfall = document.createElementNS( NSS['svg'], 'path');
+    
+}
+
+/*WaterfallWipePath.calcCenteredClock = function( nT, nE )
+{
+    var nMAX_EDGE = 2;
+
+    var aTransform = SVGIdentityMatrix.rotate( nT * 360 );
+
+    var aPoint = document.documentElement.createSVGPoint();
+    aPoint.y = -nMAX_EDGE;
+    aPoint = aPoint.matrixTransform( aTransform );
+
+    var sPathData = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
+    if( nT >= 0.875 )
+        // L -e -e
+        sPathData += 'L ' + '-' + nE + ' -' + nE + ' ';
+    if( nT >= 0.625 )
+        // L -e e
+        sPathData += 'L ' + '-' + nE + ' ' + nE + ' ';
+    if( nT >= 0.375 )
+        // L e e
+        sPathData += 'L ' + nE + ' ' + nE + ' ';
+     if( nT >= 0.125 )
+        // L e -e
+        sPathData += 'L ' + nE + ' -' + nE + ' ';
+
+    // L 0 -e
+    sPathData += 'L 0 -' + nE + ' ';
+    sPathData += 'L 0 0 ';
+    // Z
+    sPathData += 'L '  + aPoint.x + ' ' + aPoint.y;
 
+    var aPath = document.createElementNS( NSS['svg'], 'path' );
+    aPath.setAttribute( 'd', sPathData );
+    return aPath;
+};*/
+

Either remove entirely, or avoid commenting it out. ;)

+WaterfallWipePath.prototype.perform = function(  )
+{
+    m_waterfall.append(document.documentElement.createSVGPoint(0.0, -1.0));
+    
+    for ( var pos = sqrtElements; pos--; )
+    {
+        var xPos = (sqrtElements - pos - 1);
+     var yPos = pruneScaleValue( ((pos + 1) * elementEdge) - 1.0 );
+     m_waterfall.append( document.createElement.createSVGPoint(
+                                 pruneScaleValue( xPos * elementEdge ),
+                                    yPos ) );
+     m_waterfall.append( document.createElement.createSVGPoint(
+                                    pruneScaleValue( (xPos + 1) * elementEdge ),
+                                    yPos ) );
+    }
+    m_waterfall.append( document.createElement.createSVGPoint( 1.0 , -1.0) );
+  
+    return m_waterfall;
+};

Please fix alignment in the function above.

 // ------------------------------------------------------------------------------------------ //
 /** Class AnimatedSlide
  *  This class handle a slide element during a slide transition.
-- 
1.7.10.4


Cheers,

-- Thorsten

Attachment: signature.asc
Description: Digital signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.