summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-08-19 21:01:59 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-08-19 21:01:59 +0000
commit973bb936248d7c060305f625ef7e5ee9f21f5aa6 (patch)
tree2327b5a20c88cfbc018ee7a097d6a697412bedd1 /canvas
parent5212ed9ebf66ab3dd8295ccde19d72cb9fec3f1c (diff)
INTEGRATION: CWS aw033 (1.13.14); FILE MERGED
2008/07/11 11:30:55 aw 1.13.14.5: RESYNC: (1.14-1.15); FILE MERGED 2008/05/14 13:29:20 aw 1.13.14.4: RESYNC: (1.13-1.14); FILE MERGED 2007/12/18 14:56:23 aw 1.13.14.3: #i39532# corrected clipping changes 2007/12/12 13:17:26 aw 1.13.14.2: #i39532# clipping changes 2007/12/04 11:11:38 aw 1.13.14.1: #i39532# changes after resync
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/tools/image.cxx64
1 files changed, 9 insertions, 55 deletions
diff --git a/canvas/source/tools/image.cxx b/canvas/source/tools/image.cxx
index e9efb7ac89c9..49d1e7daa672 100644
--- a/canvas/source/tools/image.cxx
+++ b/canvas/source/tools/image.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: image.cxx,v $
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
* This file is part of OpenOffice.org.
*
@@ -55,6 +55,8 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <basegfx/tools/canvastools.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include "image.hxx"
@@ -270,33 +272,9 @@ namespace canvas { namespace
// clip contour against renderclip
if( pRenderClip )
{
- // TODO(F2): review subdivision algo, maybe use hybrid
- // approach from mcseem also in basegfx
- if(aPolyPolygon.areControlPointsUsed())
- aPolyPolygon = ::basegfx::tools::adaptiveSubdivideByAngle(aPolyPolygon);
-
- if( bIsFilledPolyPolygon )
- {
- ::basegfx::B2DPolyPolygon clip(*pRenderClip);
- aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon);
- aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon,
- sal_True);
- clip = ::basegfx::tools::removeAllIntersections(clip);
- clip = ::basegfx::tools::removeNeutralPolygons(clip,
- sal_True);
- aPolyPolygon.append(clip);
- aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon);
- aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon,
- sal_False);
- }
- else
- {
- // TODO(F3): add AW's addition to clipPolyPolygonOnPolyPolygon
- // regarding open/close state
- aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(aPolyPolygon,
- *pRenderClip,
- true);
- }
+ // AW: Simplified
+ aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(
+ aPolyPolygon, *pRenderClip, true, !bIsFilledPolyPolygon);
}
if( !aPolyPolygon.count() )
@@ -308,33 +286,9 @@ namespace canvas { namespace
// clip contour against viewclip
if( pViewClip )
{
- // TODO(F2): review subdivision algo, maybe use hybrid
- // approach from mcseem also in basegfx
- if(aPolyPolygon.areControlPointsUsed())
- aPolyPolygon = ::basegfx::tools::adaptiveSubdivideByAngle(aPolyPolygon);
-
- if( bIsFilledPolyPolygon )
- {
- ::basegfx::B2DPolyPolygon clip(*pViewClip);
- aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon);
- aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon,
- sal_True);
- clip = ::basegfx::tools::removeAllIntersections(clip);
- clip = ::basegfx::tools::removeNeutralPolygons(clip,
- sal_True);
- aPolyPolygon.append(clip);
- aPolyPolygon = ::basegfx::tools::removeAllIntersections(aPolyPolygon);
- aPolyPolygon = ::basegfx::tools::removeNeutralPolygons(aPolyPolygon,
- sal_False);
- }
- else
- {
- // TODO(F3): add AW's addition to clipPolyPolygonOnPolyPolygon
- // regarding open/close state
- aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(aPolyPolygon,
- *pViewClip,
- true);
- }
+ // AW: Simplified
+ aPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(
+ aPolyPolygon, *pViewClip, true, !bIsFilledPolyPolygon);
}
if(!(aPolyPolygon.count()))