diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-11-02 12:43:58 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-11-02 12:43:58 +0000 |
commit | c571b8b359566a07c005ee84345d15505a24bb02 (patch) | |
tree | 83e96bfc188713516adf37d2a6fdbf2fc8345ab6 /cppcanvas | |
parent | INTEGRATION: CWS canvas02 (1.5.8); FILE MERGED (diff) | |
download | core-c571b8b359566a07c005ee84345d15505a24bb02.tar.gz core-c571b8b359566a07c005ee84345d15505a24bb02.zip |
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)
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/wrapper/implsprite.cxx | 52 |
1 files changed, 35 insertions, 17 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 ); - - // 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 ); - - mxSprite->clip( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxGraphicDevice, - aTransformedClipPoly ) ); + 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 ); + + // transform polygon from view to device coordinate space + aTransformedClipPoly.transform( aViewTransform ); + + 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; |