summaryrefslogtreecommitdiff
path: root/svx/source/sdr/overlay/overlaymanager.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-08-19 22:13:37 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-08-19 22:13:37 +0000
commitdf1a2751f47070cc503f4df2168433b5f4d31acc (patch)
tree746473dd5710598d026ae595d14ff8c422676614 /svx/source/sdr/overlay/overlaymanager.cxx
parentd3f128c16f2dd2cf08d457e1b00864fb7f78071a (diff)
INTEGRATION: CWS aw033 (1.2.30); FILE MERGED
2008/06/26 16:30:17 aw 1.2.30.8: corrections after resync 2008/05/27 14:49:59 aw 1.2.30.7: #i39532# changes DEV300 m12 resync corrections 2008/05/14 14:00:05 aw 1.2.30.6: RESYNC: (1.5-1.6); FILE MERGED 2007/12/12 13:26:44 aw 1.2.30.5: #i39532# clipping changes 2007/11/20 10:21:39 aw 1.2.30.4: #i39532# corrected animated overlay initialisation 2007/08/09 18:49:11 aw 1.2.30.3: RESYNC: (1.3-1.5); FILE MERGED 2006/12/12 14:48:26 aw 1.2.30.2: RESYNC: (1.2-1.3); FILE MERGED 2006/12/11 17:40:59 aw 1.2.30.1: #i39532# changes after resync
Diffstat (limited to 'svx/source/sdr/overlay/overlaymanager.cxx')
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx73
1 files changed, 56 insertions, 17 deletions
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 9a05a48aac1c..125131c18572 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: overlaymanager.cxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
* This file is part of OpenOffice.org.
*
@@ -38,6 +38,7 @@
#include <vcl/outdev.hxx>
#include <vcl/window.hxx>
#include <svx/sdr/overlay/overlayobject.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,17 +50,35 @@ namespace sdr
{
::sdr::overlay::OverlayObject* pCurrent = mpOverlayObjectStart;
- while(pCurrent)
+ if(pCurrent)
{
- if(pCurrent->isVisible())
+ const sal_uInt16 nOriginalAA(rDestinationDevice.GetAntialiasing());
+
+ // react on AntiAliasing settings
+ if(maDrawinglayerOpt.IsAntiAliasing())
+ {
+ rDestinationDevice.SetAntialiasing(nOriginalAA | ANTIALIASING_ENABLE_B2DDRAW);
+ }
+ else
+ {
+ rDestinationDevice.SetAntialiasing(nOriginalAA & ~ANTIALIASING_ENABLE_B2DDRAW);
+ }
+
+ while(pCurrent)
{
- if(rRange.overlaps(pCurrent->getBaseRange()))
+ if(pCurrent->isVisible())
{
- pCurrent->drawGeometry(rDestinationDevice);
+ if(rRange.overlaps(pCurrent->getBaseRange()))
+ {
+ pCurrent->drawGeometry(rDestinationDevice);
+ }
}
+
+ pCurrent = pCurrent->mpNext;
}
- pCurrent = pCurrent->mpNext;
+ // restore AA settings
+ rDestinationDevice.SetAntialiasing(nOriginalAA);
}
}
@@ -107,7 +126,8 @@ namespace sdr
mpOverlayObjectEnd(0L),
maStripeColorA(Color(COL_BLACK)),
maStripeColorB(Color(COL_WHITE)),
- mnStripeLengthPixel(5L)
+ mnStripeLengthPixel(5L),
+ maDrawinglayerOpt()
{
}
@@ -186,8 +206,11 @@ namespace sdr
// handle evtl. animation
if(rOverlayObject.allowsAnimation())
{
- InsertEvent(&rOverlayObject);
- Execute();
+ // Trigger at current time to get alive. This will do the
+ // object-specific next time calculation and hand over adding
+ // again to the scheduler to the animated object, too. This works for
+ // a paused or non-paused animator.
+ rOverlayObject.Trigger(GetTime());
}
}
@@ -235,14 +258,30 @@ namespace sdr
{
if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType())
{
- // #i77674# transform to rectangle. Use floor/ceil to get all covered
- // discrete pixels, see #i75163# and OverlayManagerBuffered::invalidateRange
- const Rectangle aInvalidateRectangle(
- (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
- (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY()));
-
- // simply invalidate
- ((Window&)getOutputDevice()).Invalidate(aInvalidateRectangle, INVALIDATE_NOERASE);
+ if(maDrawinglayerOpt.IsAntiAliasing())
+ {
+ // assume AA needs one pixel more and invalidate one pixel more
+ const basegfx::B2DVector aDiscreteInLogic(getOutputDevice().GetViewTransformation() * basegfx::B2DVector(1.0, 1.0));
+ const Rectangle aInvalidateRectangle(
+ (sal_Int32)floor(rRange.getMinX() - aDiscreteInLogic.getX()),
+ (sal_Int32)floor(rRange.getMinY() - aDiscreteInLogic.getY()),
+ (sal_Int32)ceil(rRange.getMaxX() + aDiscreteInLogic.getX()),
+ (sal_Int32)ceil(rRange.getMaxY() + aDiscreteInLogic.getY()));
+
+ // simply invalidate
+ ((Window&)getOutputDevice()).Invalidate(aInvalidateRectangle, INVALIDATE_NOERASE);
+ }
+ else
+ {
+ // #i77674# transform to rectangle. Use floor/ceil to get all covered
+ // discrete pixels, see #i75163# and OverlayManagerBuffered::invalidateRange
+ const Rectangle aInvalidateRectangle(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY()));
+
+ // simply invalidate
+ ((Window&)getOutputDevice()).Invalidate(aInvalidateRectangle, INVALIDATE_NOERASE);
+ }
}
}