summaryrefslogtreecommitdiff
path: root/basegfx/source/range
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-11-14 13:09:48 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-11-14 13:09:48 +0000
commite85f21f2cec4d00601d300adfeee70f3b70e63a2 (patch)
tree5277029cea9aa26ccdab4a56bd751e3555ec98ec /basegfx/source/range
parent417f4438b65c0bb8ab982293372891e5f04ab34e (diff)
INTEGRATION: CWS aw024 (1.7.4); FILE MERGED
2006/09/21 21:03:15 aw 1.7.4.2: RESYNC: (1.7-1.8); FILE MERGED 2006/03/15 11:12:44 aw 1.7.4.1: #i39528# Added transform to B2DRange
Diffstat (limited to 'basegfx/source/range')
-rw-r--r--basegfx/source/range/b2drange.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/basegfx/source/range/b2drange.cxx b/basegfx/source/range/b2drange.cxx
index 22741a7171ad..ad7ea42c081a 100644
--- a/basegfx/source/range/b2drange.cxx
+++ b/basegfx/source/range/b2drange.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: b2drange.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 08:04:56 $
+ * last change: $Author: ihi $ $Date: 2006-11-14 14:09:48 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -48,6 +48,10 @@
#include <basegfx/numeric/ftools.hxx>
#endif
+#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#endif
+
namespace basegfx
{
B2DRange::B2DRange( const B2IRange& rRange ) :
@@ -64,6 +68,19 @@ namespace basegfx
}
}
+ void B2DRange::transform(const B2DHomMatrix& rMatrix)
+ {
+ if(!isEmpty() && !rMatrix.isIdentity())
+ {
+ const B2DRange aSource(*this);
+ reset();
+ expand(rMatrix * B2DPoint(aSource.getMinX(), aSource.getMinY()));
+ expand(rMatrix * B2DPoint(aSource.getMaxX(), aSource.getMinY()));
+ expand(rMatrix * B2DPoint(aSource.getMinX(), aSource.getMaxY()));
+ expand(rMatrix * B2DPoint(aSource.getMaxX(), aSource.getMaxY()));
+ }
+ }
+
B2IRange fround(const B2DRange& rRange)
{
return rRange.isEmpty() ?