diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-11-02 13:00:22 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-11-02 13:00:22 +0000 |
commit | c2834d28631daffd141e4261710463294fd8573b (patch) | |
tree | 28d62565014e3c0ee8bd5229d447619a20ffe07e /basegfx/source/range | |
parent | 927fad7930429f0630bfc575f5e2b9b826642ff5 (diff) |
INTEGRATION: CWS canvas02 (1.6.10); FILE MERGED
2005/10/24 16:16:18 thb 1.6.10.1: #i48939# The int<->double conversions now preserve the empty state of ranges
Diffstat (limited to 'basegfx/source/range')
-rw-r--r-- | basegfx/source/range/b2drange.cxx | 23 | ||||
-rw-r--r-- | basegfx/source/range/b3drange.cxx | 37 |
2 files changed, 39 insertions, 21 deletions
diff --git a/basegfx/source/range/b2drange.cxx b/basegfx/source/range/b2drange.cxx index 1679a5b33b4e..bb99bff9a4ef 100644 --- a/basegfx/source/range/b2drange.cxx +++ b/basegfx/source/range/b2drange.cxx @@ -4,9 +4,9 @@ * * $RCSfile: b2drange.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2005-09-07 20:50:21 $ + * last change: $Author: kz $ $Date: 2005-11-02 13:59:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -48,16 +48,25 @@ namespace basegfx { B2DRange::B2DRange( const B2IRange& rRange ) : - maRangeX(rRange.getMinX()), - maRangeY(rRange.getMinY()) + maRangeX(), + maRangeY() { - maRangeX.expand(rRange.getMaxX()); - maRangeY.expand(rRange.getMaxY()); + if( !rRange.isEmpty() ) + { + maRangeX = rRange.getMinX(); + maRangeY = rRange.getMinY(); + + maRangeX.expand(rRange.getMaxX()); + maRangeY.expand(rRange.getMaxY()); + } } B2IRange fround(const B2DRange& rRange) { - return B2IRange(fround(rRange.getMinimum()), fround(rRange.getMaximum())); + return rRange.isEmpty() ? + B2IRange() : + B2IRange(fround(rRange.getMinimum()), + fround(rRange.getMaximum())); } } // end of namespace basegfx diff --git a/basegfx/source/range/b3drange.cxx b/basegfx/source/range/b3drange.cxx index 87247f051f44..ee3b572b9eac 100644 --- a/basegfx/source/range/b3drange.cxx +++ b/basegfx/source/range/b3drange.cxx @@ -4,9 +4,9 @@ * * $RCSfile: b3drange.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2005-09-07 20:50:36 $ + * last change: $Author: kz $ $Date: 2005-11-02 14:00:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -48,23 +48,32 @@ namespace basegfx { B3DRange::B3DRange(const B3IRange& rRange) : - maRangeX( rRange.getMinX() ), - maRangeY( rRange.getMinY() ), - maRangeZ( rRange.getMinZ() ) + maRangeX(), + maRangeY(), + maRangeZ() { - maRangeX.expand( rRange.getMaxX() ); - maRangeY.expand( rRange.getMaxY() ); - maRangeZ.expand( rRange.getMaxZ() ); + if( !rRange.isEmpty() ) + { + maRangeX = rRange.getMinX(); + maRangeY = rRange.getMinY(); + maRangeZ = rRange.getMinZ(); + + maRangeX.expand( rRange.getMaxX() ); + maRangeY.expand( rRange.getMaxY() ); + maRangeZ.expand( rRange.getMaxZ() ); + } } B3IRange fround(const B3DRange& rRange ) { - return B3IRange(fround(rRange.getMinX()), - fround(rRange.getMinY()), - fround(rRange.getMinZ()), - fround(rRange.getMaxX()), - fround(rRange.getMaxY()), - fround(rRange.getMaxZ())); + return rRange.isEmpty() ? + B3IRange() : + B3IRange(fround(rRange.getMinX()), + fround(rRange.getMinY()), + fround(rRange.getMinZ()), + fround(rRange.getMaxX()), + fround(rRange.getMaxY()), + fround(rRange.getMaxZ())); } } // end of namespace basegfx |