diff options
author | Mayank Gupta <techfreakworm@gmail.com> | 2016-03-30 11:47:01 +0530 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-06-09 09:54:55 +0000 |
commit | 248c5ea771255b54e64394458a321ccf829bbd02 (patch) | |
tree | 62e1a344fe05e5bde6e0119a7395d10c8d64a7d1 /slideshow | |
parent | a97b392879c96145701b2454b26dc0c4f6aa4bb2 (diff) |
Slideshow: Add 'Oval' Shape Transition variant
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.cxx | 25 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/ellipsewipe.hxx | 4 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/transitionfactorytab.cxx | 2 |
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..c3dd9ccb8aaa 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 }, |