Related: #i74211# added frame to better see graphic

(cherry picked from commit cd6db555e6a2b3befc11698fe2a3c443780b6a7d)

Change-Id: I35c3681469c7fec958437de566bfaa15c85266e0
This commit is contained in:
Armin Le Grand
2013-06-12 16:56:18 +00:00
committed by Caolán McNamara
parent 3a8dbb6319
commit d24f5f8ab8

View File

@@ -63,6 +63,7 @@
#include <drawinglayer/primitive2d/graphicprimitive2d.hxx> #include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx> #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// #i15222# // #i15222#
@@ -2455,9 +2456,10 @@ void SdrCropViewHdl::CreateB2dIAObject()
aCropped.transform(aBackToUnit); aCropped.transform(aBackToUnit);
// prepare crop PolyPolygon // prepare crop PolyPolygon
basegfx::B2DPolyPolygon aCropPolyPolygon( basegfx::B2DPolygon aGraphicOutlinePolygon(
basegfx::tools::createPolygonFromRect( basegfx::tools::createPolygonFromRect(
aCropped)); aCropped));
basegfx::B2DPolyPolygon aCropPolyPolygon(aGraphicOutlinePolygon);
// current range is unit range // current range is unit range
basegfx::B2DRange aOverlap(0.0, 0.0, 1.0, 1.0); basegfx::B2DRange aOverlap(0.0, 0.0, 1.0, 1.0);
@@ -2473,6 +2475,7 @@ void SdrCropViewHdl::CreateB2dIAObject()
// transform to object coordinates to prepare for clip // transform to object coordinates to prepare for clip
aCropPolyPolygon.transform(maObjectTransform); aCropPolyPolygon.transform(maObjectTransform);
aGraphicOutlinePolygon.transform(maObjectTransform);
// create cropped transformation // create cropped transformation
basegfx::B2DHomMatrix aCroppedTransform; basegfx::B2DHomMatrix aCroppedTransform;
@@ -2492,11 +2495,24 @@ void SdrCropViewHdl::CreateB2dIAObject()
aCroppedTransform, aCroppedTransform,
maGraphic)); maGraphic));
// prepare outline polygon for whole graphic
const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
const drawinglayer::primitive2d::Primitive2DReference aGraphicOutline(
new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
aGraphicOutlinePolygon,
aHilightColor));
// combine these
drawinglayer::primitive2d::Primitive2DSequence aCombination(2);
aCombination[0] = aGraphic;
aCombination[1] = aGraphicOutline;
// embed to MaskPrimitive2D // embed to MaskPrimitive2D
const drawinglayer::primitive2d::Primitive2DReference aMaskedGraphic( const drawinglayer::primitive2d::Primitive2DReference aMaskedGraphic(
new drawinglayer::primitive2d::MaskPrimitive2D( new drawinglayer::primitive2d::MaskPrimitive2D(
aCropPolyPolygon, aCropPolyPolygon,
drawinglayer::primitive2d::Primitive2DSequence(&aGraphic, 1))); aCombination));
// embed to UnifiedTransparencePrimitive2D // embed to UnifiedTransparencePrimitive2D
const drawinglayer::primitive2d::Primitive2DReference aTransparenceMaskedGraphic( const drawinglayer::primitive2d::Primitive2DReference aTransparenceMaskedGraphic(