summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2007-07-18 09:43:17 +0000
committerOliver Bolte <obo@openoffice.org>2007-07-18 09:43:17 +0000
commite48ba79988a7fdc23a6106d1864cc94c823fde9c (patch)
tree1bb60e0838ffbcfce5b0ae32ddd1312fa70a7dde /canvas
parent017d95971f70c76a3558bf213cfc261efd94c520 (diff)
INTEGRATION: CWS aw051 (1.5.28); FILE MERGED
2007/06/20 12:34:56 aw 1.5.28.1: Adaptions after resync
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/tools/spriteredrawmanager.cxx32
1 files changed, 22 insertions, 10 deletions
diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx
index 4deff0f81487..7cbde8aa77b4 100644
--- a/canvas/source/tools/spriteredrawmanager.cxx
+++ b/canvas/source/tools/spriteredrawmanager.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: spriteredrawmanager.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: obo $ $Date: 2007-07-17 14:24:31 $
+ * last change: $Author: obo $ $Date: 2007-07-18 10:43:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -326,6 +326,22 @@ namespace canvas
}
}
+#if OSL_DEBUG_LEVEL > 0
+ bool impIsEqualB2DRange(const basegfx::B2DRange& rRangeA, const basegfx::B2DRange& rRangeB, double fSmallValue)
+ {
+ return fabs(rRangeB.getMinX() - rRangeA.getMinX()) <= fSmallValue
+ && fabs(rRangeB.getMinY() - rRangeA.getMinY()) <= fSmallValue
+ && fabs(rRangeB.getMaxX() - rRangeA.getMaxX()) <= fSmallValue
+ && fabs(rRangeB.getMaxY() - rRangeA.getMaxY()) <= fSmallValue;
+ }
+
+ bool impIsEqualB2DVector(const basegfx::B2DVector& rVecA, const basegfx::B2DVector& rVecB, double fSmallValue)
+ {
+ return fabs(rVecB.getX() - rVecA.getX()) <= fSmallValue
+ && fabs(rVecB.getY() - rVecA.getY()) <= fSmallValue;
+ }
+#endif
+
bool SpriteRedrawManager::isAreaUpdateScroll( ::basegfx::B2DRectangle& o_rMoveStart,
::basegfx::B2DRectangle& o_rMoveEnd,
const UpdateArea& rUpdateArea,
@@ -366,14 +382,10 @@ namespace canvas
::basegfx::B2DRectangle aTotalBounds( o_rMoveStart );
aTotalBounds.expand( o_rMoveEnd );
- OSL_POSTCOND( rUpdateArea.maTotalBounds.equal(
- ::basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange( aTotalBounds ),
- 0.5 ),
- "SpriteRedrawManager::isAreaUpdateScroll(): sprite area and total area mismatch" );
- OSL_POSTCOND( o_rMoveStart.getRange().equal(
- o_rMoveEnd.getRange(),
- 0.5 ),
- "SpriteRedrawManager::isAreaUpdateScroll(): scroll start and end area have mismatching size" );
+ OSL_POSTCOND(impIsEqualB2DRange(rUpdateArea.maTotalBounds, basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange(aTotalBounds), 0.5),
+ "SpriteRedrawManager::isAreaUpdateScroll(): sprite area and total area mismatch");
+ OSL_POSTCOND(impIsEqualB2DVector(o_rMoveStart.getRange(), o_rMoveEnd.getRange(), 0.5),
+ "SpriteRedrawManager::isAreaUpdateScroll(): scroll start and end area have mismatching size");
#endif
return true;