Kaydet (Commit) 3fd725f8 authored tarafından Marco Cecchetti's avatar Marco Cecchetti Kaydeden (comit) Marco Cecchetti

svg export: borders of leaving slide are not covered by the entering one

Change-Id: Ib467c062e68fa8fe2a104daff399407aefffbb3f
Reviewed-on: https://gerrit.libreoffice.org/20807Reviewed-by: 's avatarMarco Cecchetti <mrcekets@gmail.com>
Tested-by: 's avatarMarco Cecchetti <mrcekets@gmail.com>
üst 69fd971e
...@@ -735,6 +735,7 @@ var aOOOElemMetaSlides = 'ooo:meta_slides'; ...@@ -735,6 +735,7 @@ var aOOOElemMetaSlides = 'ooo:meta_slides';
var aOOOElemMetaSlide = 'ooo:meta_slide'; var aOOOElemMetaSlide = 'ooo:meta_slide';
var aOOOElemTextField = 'ooo:text_field'; var aOOOElemTextField = 'ooo:text_field';
var aPresentationClipPathId = 'presentation_clip_path'; var aPresentationClipPathId = 'presentation_clip_path';
var aPresentationClipPathShrinkId = 'presentation_clip_path_shrink';
// ooo attributes // ooo attributes
var aOOOAttrNumberOfSlides = 'number-of-slides'; var aOOOAttrNumberOfSlides = 'number-of-slides';
...@@ -1948,8 +1949,12 @@ MasterPageView.prototype.createElement = function() ...@@ -1948,8 +1949,12 @@ MasterPageView.prototype.createElement = function()
// that is also a workaround for some kind of slide transition // that is also a workaround for some kind of slide transition
// when the master page is empty // when the master page is empty
var aWhiteRect = theDocument.createElementNS( NSS['svg'], 'rect' ); var aWhiteRect = theDocument.createElementNS( NSS['svg'], 'rect' );
aWhiteRect.setAttribute( 'width', String( WIDTH ) ); var nWidthExt = WIDTH / 1000;
aWhiteRect.setAttribute( 'height', String( HEIGHT) ); var nHeightExt = HEIGHT / 1000;
aWhiteRect.setAttribute( 'x', String( -nWidthExt / 2 ) );
aWhiteRect.setAttribute( 'y', String( -nHeightExt / 2 ) );
aWhiteRect.setAttribute( 'width', String( WIDTH + nWidthExt ) );
aWhiteRect.setAttribute( 'height', String( HEIGHT + nHeightExt ) );
aWhiteRect.setAttribute( 'fill', '#FFFFFF' ); aWhiteRect.setAttribute( 'fill', '#FFFFFF' );
aMasterPageViewElement.appendChild( aWhiteRect ); aMasterPageViewElement.appendChild( aWhiteRect );
...@@ -12413,7 +12418,16 @@ SlideShow.prototype.notifySlideStart = function( nNewSlideIndex, nOldSlideIndex ...@@ -12413,7 +12418,16 @@ SlideShow.prototype.notifySlideStart = function( nNewSlideIndex, nOldSlideIndex
SlideShow.prototype.notifyTransitionEnd = function( nSlideIndex ) SlideShow.prototype.notifyTransitionEnd = function( nSlideIndex )
{ {
theMetaDoc.setCurrentSlide( nSlideIndex ); // reset the presentation clip path on the leaving slide
// to the standard one when transition ends
if( theMetaDoc.getCurrentSlide() )
{
var sRef = 'url(#' + aPresentationClipPathId + ')';
theMetaDoc.getCurrentSlide().slideElement.setAttribute('clip-path', sRef);
}
theMetaDoc.setCurrentSlide(nSlideIndex);
if( this.aSlideViewElement ) if( this.aSlideViewElement )
{ {
theMetaDoc.getCurrentSlide().aVisibilityStatusElement.parentNode.removeChild( this.aSlideViewElement ); theMetaDoc.getCurrentSlide().aVisibilityStatusElement.parentNode.removeChild( this.aSlideViewElement );
...@@ -12790,6 +12804,11 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition ) ...@@ -12790,6 +12804,11 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition )
var aSlideTransitionHandler = aNewMetaSlide.aTransitionHandler; var aSlideTransitionHandler = aNewMetaSlide.aTransitionHandler;
if( aSlideTransitionHandler && aSlideTransitionHandler.isValid() ) if( aSlideTransitionHandler && aSlideTransitionHandler.isValid() )
{ {
// clipPath element used for the leaving slide in order
// to avoid that slide borders are visible during transition
var sRef = 'url(#' + aPresentationClipPathShrinkId + ')';
aOldMetaSlide.slideElement.setAttribute( 'clip-path', sRef );
// when we switch from the last to the first slide we need to hide the last slide // when we switch from the last to the first slide we need to hide the last slide
// or nobody will see the transition, hence we create a view of the last slide and // or nobody will see the transition, hence we create a view of the last slide and
// we place it before the first slide // we place it before the first slide
...@@ -12800,6 +12819,7 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition ) ...@@ -12800,6 +12819,7 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition )
aNewMetaSlide.aVisibilityStatusElement.parentNode.insertBefore( this.aSlideViewElement, aNewMetaSlide.aVisibilityStatusElement ); aNewMetaSlide.aVisibilityStatusElement.parentNode.insertBefore( this.aSlideViewElement, aNewMetaSlide.aVisibilityStatusElement );
aOldMetaSlide.hide(); aOldMetaSlide.hide();
} }
var aLeavingSlide = aOldMetaSlide; var aLeavingSlide = aOldMetaSlide;
var aEnteringSlide = aNewMetaSlide; var aEnteringSlide = aNewMetaSlide;
var aTransitionEndEvent = makeEvent( bind2( this.notifyTransitionEnd, this, nNewSlide ) ); var aTransitionEndEvent = makeEvent( bind2( this.notifyTransitionEnd, this, nNewSlide ) );
......
...@@ -847,6 +847,22 @@ bool SVGFilter::implExportDocument() ...@@ -847,6 +847,22 @@ bool SVGFilter::implExportDocument()
SvXMLElementExport aRectElem( *mpSVGExport, XML_NAMESPACE_NONE, "rect", true, true ); SvXMLElementExport aRectElem( *mpSVGExport, XML_NAMESPACE_NONE, "rect", true, true );
} }
} }
// Create a ClipPath element applied to the leaving slide in order
// to avoid that slide borders are visible during transition
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation_clip_path_shrink" );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" );
SvXMLElementExport aClipPathElem( *mpSVGExport, XML_NAMESPACE_NONE, "clipPath", true, true );
{
sal_Int32 nDocWidthExt = nDocWidth / 500;
sal_Int32 nDocHeightExt = nDocHeight / 500;
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "x", OUString::number( nDocX + nDocWidthExt / 2 ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "y", OUString::number( nDocY + nDocHeightExt / 2) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "width", OUString::number( nDocWidth - nDocWidthExt ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "height", OUString::number( nDocHeight - nDocHeightExt ) );
SvXMLElementExport aRectElem( *mpSVGExport, XML_NAMESPACE_NONE, "rect", true, true );
}
}
} }
if( implLookForFirstVisiblePage() ) // OK! We found at least one visible page. if( implLookForFirstVisiblePage() ) // OK! We found at least one visible page.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment