From c571b8b359566a07c005ee84345d15505a24bb02 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Wed, 2 Nov 2005 12:43:58 +0000 Subject: [PATCH] INTEGRATION: CWS canvas02 (1.5.8); FILE MERGED 2005/10/24 16:28:43 thb 1.5.8.3: #i48939# Providing the sprite priority also on the cppcanvas wrapper 2005/10/09 09:22:10 thb 1.5.8.2: RESYNC: (1.5-1.6); FILE MERGED 2005/06/17 23:15:11 thb 1.5.8.1: #i48939# Handle clip correctly for transparency groups; adapted clip handling for sprites (after clarifying the UNO API semantics) --- cppcanvas/source/wrapper/implsprite.cxx | 46 +++++++++++++++++-------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/cppcanvas/source/wrapper/implsprite.cxx b/cppcanvas/source/wrapper/implsprite.cxx index c1036da76398..ef461e8984a0 100644 --- a/cppcanvas/source/wrapper/implsprite.cxx +++ b/cppcanvas/source/wrapper/implsprite.cxx @@ -4,9 +4,9 @@ * * $RCSfile: implsprite.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2005-09-08 08:29:43 $ + * last change: $Author: kz $ $Date: 2005-11-02 13:43:58 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -180,8 +180,11 @@ namespace cppcanvas if( mxSprite.is() && mxGraphicDevice.is() ) { - mxSprite->clip( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxGraphicDevice, - rClipPoly ) ); + if( rClipPoly.count() == 0 ) + mxSprite->clip( uno::Reference< rendering::XPolyPolygon2D >() ); + else + mxSprite->clip( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxGraphicDevice, + rClipPoly ) ); } } @@ -192,19 +195,26 @@ namespace cppcanvas if( mxSprite.is() && mxGraphicDevice.is() ) { - ::basegfx::B2DPolyPolygon aTransformedClipPoly( rClipPoly ); + if( rClipPoly.count() == 0 ) + { + mxSprite->clip( uno::Reference< rendering::XPolyPolygon2D >() ); + } + else + { + ::basegfx::B2DPolyPolygon aTransformedClipPoly( rClipPoly ); - // extract linear part of canvas view transformation (linear means: - // without translational components) - ::basegfx::B2DHomMatrix aViewTransform( mpTransformArbiter->getTransformation() ); - aViewTransform.set( 0, 2, 0.0 ); - aViewTransform.set( 1, 2, 0.0 ); + // extract linear part of canvas view transformation (linear means: + // without translational components) + ::basegfx::B2DHomMatrix aViewTransform( mpTransformArbiter->getTransformation() ); + aViewTransform.set( 0, 2, 0.0 ); + aViewTransform.set( 1, 2, 0.0 ); - // transform polygon from view to device coordinate space - aTransformedClipPoly.transform( aViewTransform ); + // transform polygon from view to device coordinate space + aTransformedClipPoly.transform( aViewTransform ); - mxSprite->clip( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxGraphicDevice, - aTransformedClipPoly ) ); + mxSprite->clip( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxGraphicDevice, + aTransformedClipPoly ) ); + } } } @@ -224,6 +234,14 @@ namespace cppcanvas mxSprite->hide(); } + void ImplSprite::setPriority( double fPriority ) + { + OSL_ENSURE( mxSprite.is(), "ImplSprite::setPriority(): Invalid sprite"); + + if( mxSprite.is() ) + mxSprite->setPriority(fPriority); + } + uno::Reference< rendering::XSprite > ImplSprite::getUNOSprite() const { return mxSprite;