summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorMayank Gupta <techfreakworm@gmail.com>2016-03-30 11:47:01 +0530
committerMichael Stahl <mstahl@redhat.com>2016-06-10 12:14:40 +0200
commit16ddfa21d6e92af6d2ce30a3d80f7184d3a462af (patch)
tree73eed291a8e81c0971db0d3422b1c044843aef4e /slideshow
parent5cf68b0eac1a81ebcb2fa8f0e90fc4f7e350bd3a (diff)
Slideshow: Add 'Oval' Shape Transition variant
Committer's note: There is no Oval or Ellipse transition in MSO formats, so fallback to circle on export to those. Change-Id: Ibc3d617d3bb94bdd0702bb4d60ce5fbe2eea8e24 Reviewed-on: https://gerrit.libreoffice.org/23661 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/transitions/ellipsewipe.cxx25
-rw-r--r--slideshow/source/engine/transitions/ellipsewipe.hxx4
-rw-r--r--slideshow/source/engine/transitions/transitionfactorytab.cxx2
3 files changed, 22 insertions, 9 deletions
diff --git a/slideshow/source/engine/transitions/ellipsewipe.cxx b/slideshow/source/engine/transitions/ellipsewipe.cxx
index 35aa9ec69a99..d6f968fc1ffc 100644
--- a/slideshow/source/engine/transitions/ellipsewipe.cxx
+++ b/slideshow/source/engine/transitions/ellipsewipe.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
+#include <com/sun/star/animations/TransitionSubType.hpp>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include "ellipsewipe.hxx"
@@ -29,12 +29,23 @@ namespace internal {
::basegfx::B2DPolyPolygon EllipseWipe::operator () ( double t )
{
- // currently only circle:
- ::basegfx::B2DPolygon poly(
- ::basegfx::tools::createPolygonFromCircle(
- ::basegfx::B2DPoint( 0.5, 0.5 ),
- ::basegfx::pruneScaleValue( t * M_SQRT2 / 2.0 ) ) );
- return ::basegfx::B2DPolyPolygon( poly );
+ ::basegfx::B2DPoint rCenter(0.5,0.5);
+ double fRadius = ::basegfx::pruneScaleValue( t * M_SQRT2 / 2.0 );
+
+ if( mnSubType == com::sun::star::animations::TransitionSubType::VERTICAL )
+ {
+ // oval:
+ ::basegfx::B2DPolygon poly (
+ ::basegfx::tools::createPolygonFromEllipse( rCenter, fRadius*2, fRadius ) ); //Horizontal Ellipse is rotated by 90 degress
+ return ::basegfx::B2DPolyPolygon( poly );
+ }
+ else
+ {
+ // circle:
+ ::basegfx::B2DPolygon poly(
+ ::basegfx::tools::createPolygonFromCircle( rCenter, fRadius ) );
+ return ::basegfx::B2DPolyPolygon( poly );
+ }
}
}
diff --git a/slideshow/source/engine/transitions/ellipsewipe.hxx b/slideshow/source/engine/transitions/ellipsewipe.hxx
index d710cba27794..c8d991b509f8 100644
--- a/slideshow/source/engine/transitions/ellipsewipe.hxx
+++ b/slideshow/source/engine/transitions/ellipsewipe.hxx
@@ -30,8 +30,10 @@ namespace internal {
class EllipseWipe : public ParametricPolyPolygon
{
public:
- explicit EllipseWipe( sal_Int32 /*nTransitionSubType xxx todo */ ) {}
+ explicit EllipseWipe( sal_Int32 nSubType ): mnSubType( nSubType ) {}
virtual ::basegfx::B2DPolyPolygon operator () ( double x ) override;
+private:
+ sal_Int32 mnSubType;
};
}
diff --git a/slideshow/source/engine/transitions/transitionfactorytab.cxx b/slideshow/source/engine/transitions/transitionfactorytab.cxx
index 8f10a551d219..021c3592ab61 100644
--- a/slideshow/source/engine/transitions/transitionfactorytab.cxx
+++ b/slideshow/source/engine/transitions/transitionfactorytab.cxx
@@ -699,7 +699,7 @@ static const TransitionInfo lcl_transitionInfo[] =
1.0, // no scaling
TransitionInfo::REVERSEMETHOD_SUBTRACT_AND_INVERT,
true, // 'out' by parameter sweep inversion
- false // scale isotrophically to target size
+ true // scale isotrophically to target size
},