diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-04-18 09:00:40 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-04-18 09:00:40 +0000 |
commit | 3ef19d3e06cbe2a628d4fd81f876042f0813b2d8 (patch) | |
tree | f5bf22c17d880d179bdf6d242e93424852b57a3f /cppcanvas/source/mtfrenderer/pointaction.cxx | |
parent | 0bdca39b525946b1882f516a37148ff4863bdfa8 (diff) |
INTEGRATION: CWS presfixes03 (1.5.2); FILE MERGED
2005/04/01 16:09:44 thb 1.5.2.1: #i36190#, #i39245# Changed uno::Sequence::operator[] for nonconst sequences to use naked ptr; added support for true bezier polygons (and removed subdivision, where it was added because of that canvas deficiency); overhauled mtf renderer to provide faithful bounds also for subsetted meta files
Diffstat (limited to 'cppcanvas/source/mtfrenderer/pointaction.cxx')
-rw-r--r-- | cppcanvas/source/mtfrenderer/pointaction.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/cppcanvas/source/mtfrenderer/pointaction.cxx b/cppcanvas/source/mtfrenderer/pointaction.cxx index e0c031c3dc99..601016e87c81 100644 --- a/cppcanvas/source/mtfrenderer/pointaction.cxx +++ b/cppcanvas/source/mtfrenderer/pointaction.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pointaction.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-03-30 08:31:08 $ + * last change: $Author: obo $ $Date: 2005-04-18 10:00:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,9 @@ #include <vcl/canvastools.hxx> #endif +#ifndef _BGFX_RANGE_B2DRANGE_HXX +#include <basegfx/range/b2drange.hxx> +#endif #ifndef _BGFX_TOOLS_CANVASTOOLS_HXX #include <basegfx/tools/canvastools.hxx> #endif @@ -112,6 +115,10 @@ namespace cppcanvas virtual bool render( const ::basegfx::B2DHomMatrix& rTransformation, const Subset& rSubset ) const; + virtual ::basegfx::B2DRange getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const; + virtual ::basegfx::B2DRange getBounds( const ::basegfx::B2DHomMatrix& rTransformation, + const Subset& rSubset ) const; + virtual sal_Int32 getActionCount() const; private: @@ -175,6 +182,31 @@ namespace cppcanvas return render( rTransformation ); } + ::basegfx::B2DRange PointAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const + { + rendering::RenderState aLocalState( maState ); + ::canvas::tools::prependToRenderState(aLocalState, rTransformation); + + return tools::calcDevicePixelBounds( ::basegfx::B2DRange( maPoint.X()-1, + maPoint.Y()-1, + maPoint.X()+1, + maPoint.Y()+1 ), + mpCanvas->getViewState(), + aLocalState ); + } + + ::basegfx::B2DRange PointAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation, + const Subset& rSubset ) const + { + // point only contains a single action, empty bounds + // if subset requests different range + if( rSubset.mnSubsetBegin != 0 || + rSubset.mnSubsetEnd != 1 ) + return ::basegfx::B2DRange(); + + return getBounds( rTransformation ); + } + sal_Int32 PointAction::getActionCount() const { return 1; |