summaryrefslogtreecommitdiff
path: root/basegfx/source
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-10-26 11:00:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-12 15:38:50 +0100
commit70e3eb2c1762fb1ca097cf671e3c7ce3d0dfd1b7 (patch)
tree80ec388e04d6fa22e19c8ba5329cab9f2068c666 /basegfx/source
parenta70233e991619e134fde2c5ff6037960d07a06ae (diff)
Resolves: #i121267# added support for taking clipping into account...
for metafile-based exporters to vector formats (cherry picked from commit 229a79b97110c11ef21b7b99ffc768254ca01d96) Conflicts: basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx filter/source/flash/swfexporter.cxx filter/source/graphicfilter/eos2met/eos2met.cxx svtools/source/filter/wmf/wmf.cxx vcl/Package_inc.mk Remove unused variable to prevent compile warnings. (cherry picked from commit 60d19c1602e4fec740624fd20a7bfd39707297e4) Change-Id: Iaeb02d7321bea2890cf4e969f1d45d58deef5584 106285f06a21f4f39f34c6755d12ac6cd4196a7f
Diffstat (limited to 'basegfx/source')
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx2
-rw-r--r--basegfx/source/polygon/b2dpolypolygontools.cxx20
2 files changed, 20 insertions, 2 deletions
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index 24affdfb84c9..59b2813d3614 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -489,8 +489,6 @@ namespace basegfx
fRetval -= aPreviousPoint.getY() * aCurrentPoint.getX();
}
- fRetval /= 2.0;
-
// correct to zero if small enough. Also test the quadratic
// of the result since the precision is near quadratic due to
// the algorithm
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx
index 8a5337bfe4b1..c2b18eff4e44 100644
--- a/basegfx/source/polygon/b2dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolypolygontools.cxx
@@ -243,6 +243,26 @@ namespace basegfx
return aRetval;
}
+ double getSignedArea(const B2DPolyPolygon& rCandidate)
+ {
+ double fRetval(0.0);
+ const sal_uInt32 nPolygonCount(rCandidate.count());
+
+ for(sal_uInt32 a(0L); a < nPolygonCount; a++)
+ {
+ const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a));
+
+ fRetval += tools::getSignedArea(aCandidate);
+ }
+
+ return fRetval;
+ }
+
+ double getArea(const B2DPolyPolygon& rCandidate)
+ {
+ return fabs(getSignedArea(rCandidate));
+ }
+
void applyLineDashing(const B2DPolyPolygon& rCandidate, const ::std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, B2DPolyPolygon* pGapTarget, double fFullDashDotLen)
{
if(0.0 == fFullDashDotLen && rDotDashArray.size())