diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-11-02 13:00:43 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-11-02 13:00:43 +0000 |
commit | 507ff1b5df1597177cdc88ca808c57329f83438f (patch) | |
tree | 667ea28892fdcf1c670ea1d4139890be7ecb9e85 /basegfx/source | |
parent | 5710be892ee0a9b75e9d7818b1a37fe018c863a6 (diff) |
INTEGRATION: CWS canvas02 (1.4.6); FILE MERGED
2005/10/08 13:23:32 thb 1.4.6.2: RESYNC: (1.4-1.5); FILE MERGED
2005/06/17 23:08:14 thb 1.4.6.1: #i48939# Moved set difference calculation for ranges to basegfx (the computeSetDifference() methods); added more basic type conversion to canvastools
Diffstat (limited to 'basegfx/source')
-rwxr-xr-x | basegfx/source/tools/canvastools.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/basegfx/source/tools/canvastools.cxx b/basegfx/source/tools/canvastools.cxx index 0866720b84f4..51222269c4e9 100755 --- a/basegfx/source/tools/canvastools.cxx +++ b/basegfx/source/tools/canvastools.cxx @@ -4,9 +4,9 @@ * * $RCSfile: canvastools.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-09-07 20:51:06 $ + * last change: $Author: kz $ $Date: 2005-11-02 14:00:43 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -502,6 +502,22 @@ namespace basegfx rRect.Y + rRect.Height ); } + ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange ) + { + return ::basegfx::B2IRange( static_cast<sal_Int32>( floor(rRange.getMinX()) ), + static_cast<sal_Int32>( floor(rRange.getMinY()) ), + static_cast<sal_Int32>( ceil(rRange.getMaxX()) ), + static_cast<sal_Int32>( ceil(rRange.getMaxY()) ) ); + } + + ::basegfx::B2DRange b2DSurroundingIntegerRangeFromB2DRange( const ::basegfx::B2DRange& rRange ) + { + return ::basegfx::B2DRange( floor(rRange.getMinX()), + floor(rRange.getMinY()), + ceil(rRange.getMaxX()), + ceil(rRange.getMaxY()) ); + } + } // namespace bgfxtools } // namespace canvas |