diff options
author | Armin Le Grand <alg@apache.org> | 2013-01-29 12:32:36 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-16 20:01:56 +0100 |
commit | 5aee0c13cc62a81a38d4132db7972dc301c21b3d (patch) | |
tree | 00c7837aa82296623f38305ce0f47bc6e6f5586a /drawinglayer | |
parent | 9618c7627061b9eb82ad6107de78a12c764744cf (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 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx | 112 |
1 files changed, 111 insertions, 1 deletions
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx index 7cd2a1a1b50c..39cbdd87a1ff 100644 --- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx @@ -28,6 +28,8 @@ #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> #include <vcl/graph.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -111,7 +113,12 @@ namespace drawinglayer for(sal_uInt32 a(0L); a < nCount; a++) { - aRetval[a] = Primitive2DReference(new PolygonMarkerPrimitive2D(aPolyPolygon.getB2DPolygon(a), getRGBColorA(), getRGBColorB(), getDiscreteDashLength())); + aRetval[a] = Primitive2DReference( + new PolygonMarkerPrimitive2D( + aPolyPolygon.getB2DPolygon(a), + getRGBColorA(), + getRGBColorB(), + getDiscreteDashLength())); } return aRetval; @@ -473,4 +480,107 @@ namespace drawinglayer } // end of namespace primitive2d } // end of namespace drawinglayer +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence PolyPolygonSelectionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence aRetval; + + if(getTransparence() < 1.0 && getB2DPolyPolygon().count()) + { + if(getFill() && getB2DPolyPolygon().isClosed()) + { + // create fill primitive + const Primitive2DReference aFill( + new PolyPolygonColorPrimitive2D( + getB2DPolyPolygon(), + getColor())); + + aRetval = Primitive2DSequence(&aFill, 1); + } + + if(getDiscreteGrow() > 0.0) + { + const attribute::LineAttribute aLineAttribute( + getColor(), + getDiscreteGrow() * getDiscreteUnit() * 2.0); + const Primitive2DReference aFatLine( + new PolyPolygonStrokePrimitive2D( + getB2DPolyPolygon(), + aLineAttribute)); + + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aFatLine); + } + + // embed filled to transparency (if used) + if(aRetval.getLength() && getTransparence() > 0.0) + { + const Primitive2DReference aTrans( + new UnifiedTransparencePrimitive2D( + aRetval, + getTransparence())); + + aRetval = Primitive2DSequence(&aTrans, 1); + } + } + + return aRetval; + } + + PolyPolygonSelectionPrimitive2D::PolyPolygonSelectionPrimitive2D( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::BColor& rColor, + double fTransparence, + double fDiscreteGrow, + bool bFill) + : DiscreteMetricDependentPrimitive2D(), + maPolyPolygon(rPolyPolygon), + maColor(rColor), + mfTransparence(fTransparence), + mfDiscreteGrow(fabs(fDiscreteGrow)), + mbFill(bFill) + { + } + + bool PolyPolygonSelectionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive)) + { + const PolyPolygonSelectionPrimitive2D& rCompare = (PolyPolygonSelectionPrimitive2D&)rPrimitive; + + return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon() + && getColor() == rCompare.getColor() + && getTransparence() == rCompare.getTransparence() + && getDiscreteGrow() == rCompare.getDiscreteGrow() + && getFill() == rCompare.getFill()); + } + + return false; + } + + basegfx::B2DRange PolyPolygonSelectionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const + { + basegfx::B2DRange aRetval(basegfx::tools::getRange(getB2DPolyPolygon())); + + if(getDiscreteGrow() > 0.0) + { + // get the current DiscreteUnit (not sure if getDiscreteUnit() is updated here, better go safe way) + const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength()); + + aRetval.grow(fDiscreteUnit * getDiscreteGrow()); + } + + return aRetval; + } + + // provide unique ID + ImplPrimitive2DIDBlock(PolyPolygonSelectionPrimitive2D, PRIMITIVE2D_ID_POLYPOLYGONSELECTIONPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |