summaryrefslogtreecommitdiff
path: root/cppcanvas/source/mtfrenderer/bitmapaction.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-04-18 08:58:44 +0000
committerOliver Bolte <obo@openoffice.org>2005-04-18 08:58:44 +0000
commit277bc8faffc7c42e0109b07f79f70904a449f83b (patch)
tree8adea54d29e7412e50f0d96a35d7b332d92bc829 /cppcanvas/source/mtfrenderer/bitmapaction.cxx
parent9c85b81b35636c2bef85a97bf4cac95758bd8236 (diff)
INTEGRATION: CWS presfixes03 (1.5.2); FILE MERGED
2005/04/01 16:09:42 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/bitmapaction.cxx')
-rw-r--r--cppcanvas/source/mtfrenderer/bitmapaction.cxx37
1 files changed, 35 insertions, 2 deletions
diff --git a/cppcanvas/source/mtfrenderer/bitmapaction.cxx b/cppcanvas/source/mtfrenderer/bitmapaction.cxx
index fbfece7fad8e..5f3e53357aa9 100644
--- a/cppcanvas/source/mtfrenderer/bitmapaction.cxx
+++ b/cppcanvas/source/mtfrenderer/bitmapaction.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bitmapaction.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: rt $ $Date: 2005-03-30 08:25:13 $
+ * last change: $Author: obo $ $Date: 2005-04-18 09:58:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,6 +95,9 @@
#ifndef _BGFX_VECTOR_B2DSIZE_HXX
#include <basegfx/vector/b2dsize.hxx>
#endif
+#ifndef _BGFX_RANGE_B2DRANGE_HXX
+#include <basegfx/range/b2drange.hxx>
+#endif
#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
#include <basegfx/tools/canvastools.hxx>
#endif
@@ -130,6 +133,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:
@@ -241,6 +248,32 @@ namespace cppcanvas
return render( rTransformation );
}
+ ::basegfx::B2DRange BitmapAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const
+ {
+ rendering::RenderState aLocalState( maState );
+ ::canvas::tools::prependToRenderState(aLocalState, rTransformation);
+
+ const geometry::IntegerSize2D aSize( mxBitmap->getSize() );
+
+ return tools::calcDevicePixelBounds( ::basegfx::B2DRange( 0,0,
+ aSize.Width,
+ aSize.Height ),
+ mpCanvas->getViewState(),
+ aLocalState );
+ }
+
+ ::basegfx::B2DRange BitmapAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation,
+ const Subset& rSubset ) const
+ {
+ // bitmap 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 BitmapAction::getActionCount() const
{
return 1;