summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2007-10-16 14:46:52 +0000
committerArmin Weiss <aw@openoffice.org>2007-10-16 14:46:52 +0000
commit733803e2219a240e1a9db5cecec08165e6abad3b (patch)
tree1b85dc94f3d3948149bea3c8bc802a32874209ac /drawinglayer
parent4a464b7032460ebf1413d9ba159f02ee633bd1d5 (diff)
#i39532# Finetuning
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx78
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx11
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx25
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx6
-rw-r--r--drawinglayer/util/makefile.mk5
5 files changed, 93 insertions, 32 deletions
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 061c76a5c6..4d7557ec84 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: controlprimitive2d.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2007-10-15 16:11:08 $
+ * last change: $Author: aw $ $Date: 2007-10-16 15:46:43 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -93,6 +93,10 @@
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#endif
+#ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+#include <svtools/optionsdrawinglayer.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
using namespace com::sun::star;
@@ -165,13 +169,17 @@ namespace drawinglayer
static double fZoomScale(26.0); // do not ask for this constant factor, but it gets the zoom right
aScreenZoom *= fZoomScale;
- // limit to a maximum square size, e.g. 500x250 pixels (125000)
+ // limit to a maximum square size, e.g. 300x150 pixels (45000)
+ const SvtOptionsDrawinglayer aDrawinglayerOpt;
+ const double fDiscreteMax(aDrawinglayerOpt.GetQuadraticFormControlRenderLimit());
const double fDiscreteQuadratic(aDiscreteSize.getX() * aDiscreteSize.getY());
- static double fDiscreteMax(125000.0);
+ const bool bScaleUsed(fDiscreteQuadratic > fDiscreteMax);
+ double fFactor(1.0);
- if(fDiscreteQuadratic > fDiscreteMax)
+ if(bScaleUsed)
{
- const double fFactor(sqrt(fDiscreteMax / fDiscreteQuadratic));
+ // get factor and adapt to scaled size
+ fFactor = sqrt(fDiscreteMax / fDiscreteQuadratic);
aDiscreteSize *= fFactor;
aScreenZoom *= fFactor;
}
@@ -180,7 +188,7 @@ namespace drawinglayer
const sal_Int32 nSizeX(basegfx::fround(aDiscreteSize.getX()));
const sal_Int32 nSizeY(basegfx::fround(aDiscreteSize.getY()));
- if(nSizeX && nSizeY)
+ if(nSizeX > 0 && nSizeY > 0)
{
// prepare VirtualDevice
VirtualDevice aVirtualDevice(*Application::GetDefaultDevice());
@@ -210,8 +218,28 @@ namespace drawinglayer
// get bitmap
const Bitmap aContent(aVirtualDevice.GetBitmap(Point(), aSizePixel));
+ // to avoid scaling, use the Bitmap pixel size as primitive size
+ const Size aBitmapSize(aContent.GetSizePixel());
+ basegfx::B2DVector aBitmapSizeLogic(
+ rViewInformation.getInverseViewTransformation() *
+ basegfx::B2DVector(aBitmapSize.getWidth() - 1, aBitmapSize.getHeight() - 1));
+
+ if(bScaleUsed)
+ {
+ // if scaled adapt to scaled size
+ aBitmapSizeLogic /= fFactor;
+ }
+
+ // short form for scale and translate transformation
+ basegfx::B2DHomMatrix aBitmapTransform;
+
+ aBitmapTransform.set(0L, 0L, aBitmapSizeLogic.getX());
+ aBitmapTransform.set(1L, 1L, aBitmapSizeLogic.getY());
+ aBitmapTransform.set(0L, 2L, aTranslate.getX());
+ aBitmapTransform.set(1L, 2L, aTranslate.getY());
+
// create primitive
- xRetval = new BitmapPrimitive2D(BitmapEx(aContent), getTransform());
+ xRetval = new BitmapPrimitive2D(BitmapEx(aContent), aBitmapTransform);
}
catch( const uno::Exception& )
{
@@ -295,22 +323,28 @@ namespace drawinglayer
if(getTransform() == rCompare.getTransform())
{
- // annotation: It is not necessary to compare mxXControl since
- // it's creation completely relies on mxControlModel ad just
- // is there to buffer it and/or to avoid multiple creations.
- if(getControlModel().is() == rCompare.getControlModel().is())
+ // check if ControlModel references both are/are not
+ bool bRetval(getControlModel().is() == rCompare.getControlModel().is());
+
+ if(bRetval && getControlModel().is())
{
- if(getControlModel().is())
- {
- // both exist, check for equality
- return (getControlModel() == rCompare.getControlModel());
- }
- else
- {
- // none exists -> same
- return true;
- }
+ // both exist, check for equality
+ bRetval = (getControlModel() == rCompare.getControlModel());
+ }
+
+ if(bRetval)
+ {
+ // check if XControl references both are/are not
+ bRetval = (getXControl().is() == rCompare.getXControl().is());
+ }
+
+ if(bRetval && getXControl().is())
+ {
+ // both exist, check for equality
+ bRetval = (getXControl() == rCompare.getXControl());
}
+
+ return bRetval;
}
}
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 32ddf5f26e..7b06a3c57c 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sceneprimitive2d.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: aw $ $Date: 2007-03-06 12:34:30 $
+ * last change: $Author: aw $ $Date: 2007-10-16 15:46:43 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -85,6 +85,10 @@
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#endif
+#ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+#include <svtools/optionsdrawinglayer.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
using namespace com::sun::star;
@@ -143,7 +147,8 @@ namespace drawinglayer
const double fViewSizeX(fLogicSizeX * (rViewInformation.getViewTransformation() * basegfx::B2DVector(aUnitVisiblePart.getWidth(), 0.0)).getLength());
const double fViewSizeY(fLogicSizeY * (rViewInformation.getViewTransformation() * basegfx::B2DVector(0.0, aUnitVisiblePart.getHeight())).getLength());
const double fViewVisibleArea(fViewSizeX * fViewSizeY);
- const double fMaximumVisibleArea(1000000.0);
+ const SvtOptionsDrawinglayer aDrawinglayerOpt;
+ const double fMaximumVisibleArea(aDrawinglayerOpt.GetQuadratic3DRenderLimit());
double fReduceFactor(1.0);
if(fViewVisibleArea > fMaximumVisibleArea)
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index df3af9ca51..f0c19c9a30 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: vclpixelprocessor2d.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: aw $ $Date: 2007-10-15 16:11:08 $
+ * last change: $Author: aw $ $Date: 2007-10-16 15:46:43 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -105,6 +105,10 @@
#include <com/sun/star/awt/XWindow2.hpp>
#endif
+#ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
+#include <svtools/optionsdrawinglayer.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -120,12 +124,27 @@ namespace drawinglayer
// prepare output directly to pixels
mpOutputDevice->Push(PUSH_MAPMODE);
mpOutputDevice->SetMapMode();
+
+ // set AntiAliasing
+ const SvtOptionsDrawinglayer aDrawinglayerOpt;
+
+ if(aDrawinglayerOpt.IsAntiAliasing())
+ {
+ mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_DISABLE_POLYGONS);
+ }
+ else
+ {
+ mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() | ANTIALIASING_DISABLE_POLYGONS);
+ }
}
VclPixelProcessor2D::~VclPixelProcessor2D()
{
// restore MapMode
mpOutputDevice->Pop();
+
+ // restore AntiAliasing
+ mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() | ANTIALIASING_DISABLE_POLYGONS);
}
void VclPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
@@ -285,6 +304,8 @@ namespace drawinglayer
// process recursively and use the decomposition as Bitmap
process(rCandidate.get2DDecomposition(getViewInformation2D()));
}
+
+ break;
}
default :
{
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index e64c0b4722..975c1f968b 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: vclprocessor2d.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: aw $ $Date: 2007-10-15 16:11:08 $
+ * last change: $Author: aw $ $Date: 2007-10-16 15:46:43 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -916,7 +916,7 @@ namespace drawinglayer
xControlView->setGraphics(xGraphics);
// set position and size (in pixel)
- const basegfx::B2DHomMatrix aObjectToPixel(mpOutputDevice->GetViewTransformation() * rControlPrimitive2D.getTransform());
+ const basegfx::B2DHomMatrix aObjectToPixel(maCurrentTransformation * rControlPrimitive2D.getTransform());
const basegfx::B2DPoint aTopLeftPixel(aObjectToPixel * basegfx::B2DPoint(0.0, 0.0));
Reference< XWindow > xControlWindow(rControlPrimitive2D.getXControl(), UNO_QUERY);
diff --git a/drawinglayer/util/makefile.mk b/drawinglayer/util/makefile.mk
index 3eea09cbf4..90d87767c2 100644
--- a/drawinglayer/util/makefile.mk
+++ b/drawinglayer/util/makefile.mk
@@ -4,9 +4,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.9 $
#
-# last change: $Author: aw $ $Date: 2007-08-07 15:49:03 $
+# last change: $Author: aw $ $Date: 2007-10-16 15:46:52 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
@@ -63,6 +63,7 @@ SHL1STDLIBS=\
$(VCLLIB) \
$(BASEGFXLIB) \
$(TOOLSLIB) \
+ $(SVLLIB) \
$(TKLIB) \
$(SVTOOLLIB) \
$(SALLIB) \