summaryrefslogtreecommitdiff
path: root/svx/source/sdr
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-01-29 12:32:36 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-16 20:01:56 +0100
commit5aee0c13cc62a81a38d4132db7972dc301c21b3d (patch)
tree00c7837aa82296623f38305ce0f47bc6e6f5586a /svx/source/sdr
parent9618c7627061b9eb82ad6107de78a12c764744cf (diff)
Resolves: #i121532# enhanced visualisation of text edit&selection
D&D overhauled (cherry picked from commit c6e63b6bbb6b4a63fe1302de57fc32cd28432378) Conflicts: drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx svx/Package_inc.mk svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx svx/inc/svx/sdr/overlay/overlayobject.hxx svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx svx/inc/svx/sdr/overlay/overlayrectangle.hxx svx/inc/svx/sdr/overlay/overlaytools.hxx svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx svx/inc/svx/svdview.hxx svx/source/engine3d/view3d.cxx svx/source/sdr/overlay/overlayanimatedbitmapex.cxx svx/source/sdr/overlay/overlayhatchrect.cxx svx/source/sdr/overlay/overlaypolypolygon.cxx svx/source/sdr/overlay/overlaytools.cxx svx/source/svdraw/svdcrtv.cxx svx/source/svdraw/svdedxv.cxx svx/source/svdraw/svdhdl.cxx svx/source/svdraw/svdobj.cxx svx/source/svdraw/svdview.cxx sw/source/ui/dochdl/swdtflvr.cxx Unname unused arguments to prevent WaE issues. (cherry picked from commit 0735a61e631b8d4bb3d4e889bee436fb9e7c5734) Change-Id: I3b1cf4754063985dc1b4adac44b33e52e200607f e4288936cadd1f6e06bdf79611536d7114236b56
Diffstat (limited to 'svx/source/sdr')
-rw-r--r--svx/source/sdr/overlay/overlayanimatedbitmapex.cxx15
-rw-r--r--svx/source/sdr/overlay/overlayhatchrect.cxx71
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx10
-rw-r--r--svx/source/sdr/overlay/overlayobject.cxx14
-rw-r--r--svx/source/sdr/overlay/overlaypolypolygon.cxx33
-rw-r--r--svx/source/sdr/overlay/overlayrectangle.cxx150
-rw-r--r--svx/source/sdr/overlay/overlayrollingrectangle.cxx26
-rw-r--r--svx/source/sdr/overlay/overlaytools.cxx119
8 files changed, 294 insertions, 144 deletions
diff --git a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
index cf9d5842a37b..ff4d97b8c9d2 100644
--- a/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
+++ b/svx/source/sdr/overlay/overlayanimatedbitmapex.cxx
@@ -29,19 +29,6 @@ namespace sdr
{
namespace overlay
{
- // #i53216# check blink time value range
- void OverlayAnimatedBitmapEx::impCheckBlinkTimeValueRange()
- {
- if(mnBlinkTime < 25)
- {
- mnBlinkTime = 25;
- }
- else if(mnBlinkTime > 10000)
- {
- mnBlinkTime = 10000;
- }
- }
-
drawinglayer::primitive2d::Primitive2DSequence OverlayAnimatedBitmapEx::createOverlayObjectPrimitive2DSequence()
{
if(mbOverlayState)
@@ -89,7 +76,7 @@ namespace sdr
mbAllowsAnimation = true;
// #i53216# check blink time value range
- impCheckBlinkTimeValueRange();
+ mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
}
OverlayAnimatedBitmapEx::~OverlayAnimatedBitmapEx()
diff --git a/svx/source/sdr/overlay/overlayhatchrect.cxx b/svx/source/sdr/overlay/overlayhatchrect.cxx
deleted file mode 100644
index 2b6c7e1e3668..000000000000
--- a/svx/source/sdr/overlay/overlayhatchrect.cxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include <svx/sdr/overlay/overlayhatchrect.hxx>
-#include <vcl/hatch.hxx>
-#include <vcl/outdev.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/numeric/ftools.hxx>
-#include <svx/sdr/overlay/overlaytools.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace sdr
-{
- namespace overlay
- {
- drawinglayer::primitive2d::Primitive2DSequence OverlayHatchRect::createOverlayObjectPrimitive2DSequence()
- {
- const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition());
- const drawinglayer::primitive2d::Primitive2DReference aReference(
- new drawinglayer::primitive2d::OverlayHatchRectanglePrimitive(
- aHatchRange,
- 3.0,
- getHatchRotation(),
- getBaseColor().getBColor(),
- getDiscreteGrow(),
- getDiscreteShrink(),
- getRotation()));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
- }
-
- OverlayHatchRect::OverlayHatchRect(
- const basegfx::B2DPoint& rBasePosition,
- const basegfx::B2DPoint& rSecondPosition,
- const Color& rHatchColor,
- double fDiscreteGrow,
- double fDiscreteShrink,
- double fHatchRotation,
- double fRotation)
- : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
- maSecondPosition(rSecondPosition),
- mfDiscreteGrow(fDiscreteGrow),
- mfDiscreteShrink(fDiscreteShrink),
- mfHatchRotation(fHatchRotation),
- mfRotation(fRotation)
- {
- }
- } // end of namespace overlay
-} // end of namespace sdr
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 818bfc6b6b27..d9a0ef4772ac 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -157,8 +157,14 @@ namespace sdr
if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType())
{
const Size aOutputSizePixel(getOutputDevice().GetOutputSizePixel());
- aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
- aViewRange.transform(getOutputDevice().GetInverseViewTransformation());
+
+ // only set when we *have* a output size, else let aViewRange
+ // stay on empty
+ if(aOutputSizePixel.Width() && aOutputSizePixel.Height())
+ {
+ aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+ aViewRange.transform(getOutputDevice().GetInverseViewTransformation());
+ }
}
OverlayManager* pThis = const_cast< OverlayManager* >(this);
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index da15079b7f54..292cb5a0c220 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -63,6 +63,20 @@ namespace sdr
return drawinglayer::primitive2d::Primitive2DSequence();
}
+ sal_uInt32 OverlayObject::impCheckBlinkTimeValueRange(sal_uInt32 nBlinkTime) const
+ {
+ if(nBlinkTime < 25)
+ {
+ nBlinkTime = 25;
+ }
+ else if(nBlinkTime > 10000)
+ {
+ nBlinkTime = 10000;
+ }
+
+ return nBlinkTime;
+ }
+
void OverlayObject::allowAntiAliase(bool bNew)
{
if(bNew != (bool)mbAllowsAntiAliase)
diff --git a/svx/source/sdr/overlay/overlaypolypolygon.cxx b/svx/source/sdr/overlay/overlaypolypolygon.cxx
index e1b06469d1be..f85021c7e797 100644
--- a/svx/source/sdr/overlay/overlaypolypolygon.cxx
+++ b/svx/source/sdr/overlay/overlaypolypolygon.cxx
@@ -30,7 +30,7 @@ namespace sdr
{
namespace overlay
{
- drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStriped::createOverlayObjectPrimitive2DSequence()
+ drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStripedAndFilled::createOverlayObjectPrimitive2DSequence()
{
drawinglayer::primitive2d::Primitive2DSequence aRetval;
@@ -39,34 +39,47 @@ namespace sdr
const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
-
- const drawinglayer::primitive2d::Primitive2DReference aReference(
+ const drawinglayer::primitive2d::Primitive2DReference aStriped(
new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
- getPolyPolygon(),
+ getLinePolyPolygon(),
aRGBColorA,
aRGBColorB,
fStripeLengthPixel));
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aStriped, 1);
+
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+
+ const drawinglayer::primitive2d::Primitive2DReference aFilled(
+ new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
+ getLinePolyPolygon(),
+ aHilightColor,
+ fTransparence,
+ 3.0,
+ false));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aFilled);
}
return aRetval;
}
- void OverlayPolyPolygonStriped::stripeDefinitionHasChanged()
+ void OverlayPolyPolygonStripedAndFilled::stripeDefinitionHasChanged()
{
// react on OverlayManager's stripe definition change
objectChange();
}
- OverlayPolyPolygonStriped::OverlayPolyPolygonStriped(
- const basegfx::B2DPolyPolygon& rPolyPolygon)
+ OverlayPolyPolygonStripedAndFilled::OverlayPolyPolygonStripedAndFilled(
+ const basegfx::B2DPolyPolygon& rLinePolyPolygon)
: OverlayObject(Color(COL_BLACK)),
- maPolyPolygon(rPolyPolygon)
+ maLinePolyPolygon(rLinePolyPolygon)
{
}
- OverlayPolyPolygonStriped::~OverlayPolyPolygonStriped()
+ OverlayPolyPolygonStripedAndFilled::~OverlayPolyPolygonStripedAndFilled()
{
}
} // end of namespace overlay
diff --git a/svx/source/sdr/overlay/overlayrectangle.cxx b/svx/source/sdr/overlay/overlayrectangle.cxx
new file mode 100644
index 000000000000..7f07be08633d
--- /dev/null
+++ b/svx/source/sdr/overlay/overlayrectangle.cxx
@@ -0,0 +1,150 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <svx/sdr/overlay/overlayrectangle.hxx>
+#include <vcl/outdev.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/numeric/ftools.hxx>
+#include <svx/sdr/overlay/overlaytools.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <vcl/svapp.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ drawinglayer::primitive2d::Primitive2DSequence OverlayRectangle::createOverlayObjectPrimitive2DSequence()
+ {
+ const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition());
+ basegfx::BColor aColor(getBaseColor().getBColor());
+ static double fChange(0.1); // just small optical change, do not make it annoying
+
+ if(mbOverlayState)
+ {
+ aColor += basegfx::B3DTuple(fChange, fChange, fChange);
+ aColor.clamp();
+ }
+ else
+ {
+ aColor -= basegfx::B3DTuple(fChange, fChange, fChange);
+ aColor.clamp();
+ }
+
+ const drawinglayer::primitive2d::Primitive2DReference aReference(
+ new drawinglayer::primitive2d::OverlayRectanglePrimitive(
+ aHatchRange,
+ aColor,
+ getTransparence(),
+ getDiscreteGrow(),
+ getDiscreteShrink(),
+ getRotation()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
+ }
+
+ OverlayRectangle::OverlayRectangle(
+ const basegfx::B2DPoint& rBasePosition,
+ const basegfx::B2DPoint& rSecondPosition,
+ const Color& rHatchColor,
+ double fTransparence,
+ double fDiscreteGrow,
+ double fDiscreteShrink,
+ double fRotation,
+ sal_uInt32 nBlinkTime,
+ bool bAnimate)
+ : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
+ maSecondPosition(rSecondPosition),
+ mfTransparence(fTransparence),
+ mfDiscreteGrow(fDiscreteGrow),
+ mfDiscreteShrink(fDiscreteShrink),
+ mfRotation(fRotation),
+ mnBlinkTime(nBlinkTime),
+ mbOverlayState(false)
+ {
+ if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ // no animation in high contrast mode
+ bAnimate = false;
+ }
+
+ // set AllowsAnimation flag to mark this object as animation capable
+ mbAllowsAnimation = bAnimate;
+
+ // #i53216# check blink time value range
+ mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
+ }
+
+ void OverlayRectangle::setSecondPosition(const basegfx::B2DPoint& rNew)
+ {
+ if(rNew != maSecondPosition)
+ {
+ // remember new value
+ maSecondPosition = rNew;
+
+ // register change (after change)
+ objectChange();
+ }
+ }
+
+ void OverlayRectangle::setBlinkTime(sal_uInt32 nNew)
+ {
+ if(mnBlinkTime != nNew)
+ {
+ // remember new value
+ mnBlinkTime = nNew;
+
+ // #i53216# check blink time value range
+ mnBlinkTime = impCheckBlinkTimeValueRange(mnBlinkTime);
+
+ // register change (after change)
+ objectChange();
+ }
+ }
+
+ void OverlayRectangle::Trigger(sal_uInt32 nTime)
+ {
+ if(getOverlayManager())
+ {
+ // #i53216# produce event after nTime + x
+ SetTime(nTime + mnBlinkTime);
+
+ // switch state
+ if(mbOverlayState)
+ {
+ mbOverlayState = false;
+ }
+ else
+ {
+ mbOverlayState = true;
+ }
+
+ // re-insert me as event
+ getOverlayManager()->InsertEvent(this);
+
+ // register change (after change)
+ objectChange();
+ }
+ }
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/overlay/overlayrollingrectangle.cxx b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
index 977c91e2275f..496cec8d320f 100644
--- a/svx/source/sdr/overlay/overlayrollingrectangle.cxx
+++ b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
@@ -24,7 +24,7 @@
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -47,14 +47,24 @@ namespace sdr
{
// view-independent part, create directly
const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aRollingRectangle));
- const drawinglayer::primitive2d::Primitive2DReference aReference(
- new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
- aPolygon,
- aRGBColorA,
- aRGBColorB,
- fStripeLengthPixel));
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aReference);
+ aRetval.realloc(2);
+ aRetval[0] = new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ aRGBColorA,
+ aRGBColorB,
+ fStripeLengthPixel);
+
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
+ const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+
+ aRetval[1] = new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
+ basegfx::B2DPolyPolygon(aPolygon),
+ aHilightColor,
+ fTransparence,
+ 3.0,
+ false);
}
if(getExtendedLines())
diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx
index 92e0ff5866eb..d3ae3f97694c 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -28,6 +28,8 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <vcl/svapp.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -178,82 +180,121 @@ namespace drawinglayer
{
namespace primitive2d
{
- OverlayHatchRectanglePrimitive::OverlayHatchRectanglePrimitive(
+ OverlayRectanglePrimitive::OverlayRectanglePrimitive(
const basegfx::B2DRange& rObjectRange,
- double fDiscreteHatchDistance,
- double fHatchRotation,
- const basegfx::BColor& rHatchColor,
+ const basegfx::BColor& rColor,
+ double fTransparence,
double fDiscreteGrow,
double fDiscreteShrink,
double fRotation)
: DiscreteMetricDependentPrimitive2D(),
maObjectRange(rObjectRange),
- mfDiscreteHatchDistance(fDiscreteHatchDistance),
- mfHatchRotation(fHatchRotation),
- maHatchColor(rHatchColor),
+ maColor(rColor),
+ mfTransparence(fTransparence),
mfDiscreteGrow(fDiscreteGrow),
mfDiscreteShrink(fDiscreteShrink),
mfRotation(fRotation)
{}
- Primitive2DSequence OverlayHatchRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence OverlayRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
Primitive2DSequence aRetval;
+ basegfx::B2DRange aInnerRange(getObjectRange());
- if(basegfx::fTools::more(getDiscreteUnit(), 0.0))
+ if(!aInnerRange.isEmpty() && basegfx::fTools::more(getDiscreteUnit(), 0.0) && getTransparence() <= 1.0)
{
- basegfx::B2DRange aInnerRange(getObjectRange());
basegfx::B2DRange aOuterRange(getObjectRange());
- basegfx::B2DPolyPolygon aHatchPolyPolygon;
+ // grow/shrink inner/outer polygons
aOuterRange.grow(getDiscreteUnit() * getDiscreteGrow());
aInnerRange.grow(getDiscreteUnit() * -getDiscreteShrink());
- aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aOuterRange));
-
- if(!aInnerRange.isEmpty())
- {
- aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aInnerRange));
- }
-
+ // convert to polygons
+ const double fFullGrow(getDiscreteGrow() + getDiscreteShrink());
+ const double fRelativeRadiusX(fFullGrow / aOuterRange.getWidth());
+ const double fRelativeRadiusY(fFullGrow / aOuterRange.getHeight());
+ basegfx::B2DPolygon aOuterPolygon(
+ basegfx::tools::createPolygonFromRect(
+ aOuterRange,
+ fRelativeRadiusX,
+ fRelativeRadiusY));
+ basegfx::B2DPolygon aInnerPolygon(
+ basegfx::tools::createPolygonFromRect(
+ aInnerRange));
+
+ // apply evtl. existing rotation
if(!basegfx::fTools::equalZero(getRotation()))
{
const basegfx::B2DHomMatrix aTransform(basegfx::tools::createRotateAroundPoint(
getObjectRange().getMinX(), getObjectRange().getMinY(), getRotation()));
- aHatchPolyPolygon.transform(aTransform);
+ aOuterPolygon.transform(aTransform);
+ aInnerPolygon.transform(aTransform);
}
- const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0);
- const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
- drawinglayer::attribute::HATCHSTYLE_SINGLE,
- getDiscreteHatchDistance() * getDiscreteUnit(),
- getHatchRotation() - getRotation(),
- getHatchColor(),
- 3, // same default as VCL, a minimum of three discrete units (pixels) offset
- false);
- const Primitive2DReference aPrimitive(
- new PolyPolygonHatchPrimitive2D(
- aHatchPolyPolygon,
- aEmptyColor,
- aFillHatchAttribute));
+ // create filled primitive
+ basegfx::B2DPolyPolygon aPolyPolygon;
- aRetval = Primitive2DSequence(&aPrimitive, 1);
+ aPolyPolygon.append(aOuterPolygon);
+ aPolyPolygon.append(aInnerPolygon);
+
+ if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ // for high contrast, use hatch
+ const basegfx::BColor aHighContrastLineColor(Application::GetSettings().GetStyleSettings().GetFontColor().getBColor());
+ const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0);
+ const double fHatchRotation(45 * F_PI180);
+ const double fDiscreteHatchDistance(3.0);
+ const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
+ drawinglayer::attribute::HATCHSTYLE_SINGLE,
+ fDiscreteHatchDistance * getDiscreteUnit(),
+ fHatchRotation - getRotation(),
+ aHighContrastLineColor,
+ 3, // same default as VCL, a minimum of three discrete units (pixels) offset
+ false);
+ const Primitive2DReference aHatch(
+ new PolyPolygonHatchPrimitive2D(
+ aPolyPolygon,
+ aEmptyColor,
+ aFillHatchAttribute));
+
+ aRetval = Primitive2DSequence(&aHatch, 1);
+ }
+ else
+ {
+ // create fill primitive
+ const Primitive2DReference aFill(
+ new PolyPolygonColorPrimitive2D(
+ aPolyPolygon,
+ getColor()));
+
+ aRetval = Primitive2DSequence(&aFill, 1);
+
+ // embed filled to transparency (if used)
+ if(getTransparence() > 0.0)
+ {
+ const Primitive2DReference aFillTransparent(
+ new UnifiedTransparencePrimitive2D(
+ aRetval,
+ getTransparence()));
+
+ aRetval = Primitive2DSequence(&aFillTransparent, 1);
+ }
+ }
}
return aRetval;
}
- bool OverlayHatchRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
+ bool OverlayRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
{
if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
{
- const OverlayHatchRectanglePrimitive& rCompare = static_cast< const OverlayHatchRectanglePrimitive& >(rPrimitive);
+ const OverlayRectanglePrimitive& rCompare = static_cast< const OverlayRectanglePrimitive& >(rPrimitive);
return (getObjectRange() == rCompare.getObjectRange()
- && getDiscreteHatchDistance() == rCompare.getDiscreteHatchDistance()
- && getHatchRotation() == rCompare.getHatchRotation()
- && getHatchColor() == rCompare.getHatchColor()
+ && getColor() == rCompare.getColor()
+ && getTransparence() == rCompare.getTransparence()
&& getDiscreteGrow() == rCompare.getDiscreteGrow()
&& getDiscreteShrink() == rCompare.getDiscreteShrink()
&& getRotation() == rCompare.getRotation());
@@ -262,7 +303,7 @@ namespace drawinglayer
return false;
}
- ImplPrimitive2DIDBlock(OverlayHatchRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE)
+ ImplPrimitive2DIDBlock(OverlayRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYRECTANGLEPRIMITIVE)
} // end of namespace primitive2d
} // end of namespace drawinglayer