diff options
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 328bf8d1eaa1..9fe2c84aebab 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: vclprocessor2d.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: aw $ $Date: 2007-11-20 10:20:18 $ + * last change: $Author: aw $ $Date: 2007-12-03 13:54:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -169,6 +169,13 @@ #endif ////////////////////////////////////////////////////////////////////////////// +// for test, can be removed again + +#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONCLIPPER_HXX +#include <basegfx/polygon/b2dpolygonclipper.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { @@ -625,6 +632,39 @@ namespace drawinglayer basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon()); aLocalPolyPolygon.transform(maCurrentTransformation); mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon); + + static bool bTestPolygonClipping(false); + if(bTestPolygonClipping) + { + static bool bInside(true); + static bool bFilled(false); + static bool bLine(false); + + basegfx::B2DRange aRange(aLocalPolyPolygon.getB2DRange()); + aRange.grow(aRange.getWidth() * -0.1); + + if(bFilled) + { + basegfx::B2DPolyPolygon aFilledClipped(basegfx::tools::clipPolyPolygonOnRange(aLocalPolyPolygon, aRange, bInside, false)); + basegfx::BColor aRand(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0); + mpOutputDevice->SetFillColor(Color(aRand)); + mpOutputDevice->SetLineColor(); + mpOutputDevice->DrawPolyPolygon(aFilledClipped); + } + + if(bLine) + { + basegfx::B2DPolyPolygon aLineClipped(basegfx::tools::clipPolyPolygonOnRange(aLocalPolyPolygon, aRange, bInside, true)); + basegfx::BColor aRand(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0); + mpOutputDevice->SetFillColor(); + mpOutputDevice->SetLineColor(Color(aRand)); + + for(sal_uInt32 a(0); a < aLineClipped.count(); a++) + { + mpOutputDevice->DrawPolyLine(aLineClipped.getB2DPolygon(a)); + } + } + } } // direct draw of MetaFile |