summaryrefslogtreecommitdiff
path: root/basegfx/test
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-08-19 23:06:51 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-08-19 23:06:51 +0000
commit85b2b1b58c207c4d2a288a373a8cbfc907437030 (patch)
tree3578a9e812a0a94ddade19966c7aa1120c73009b /basegfx/test
parentea9f9d55ed9f852940d3278939fef038991cc9a5 (diff)
INTEGRATION: CWS aw033 (1.8.14); FILE MERGED
2008/07/11 11:38:01 aw 1.8.14.7: RESYNC: (1.12-1.13); FILE MERGED 2008/05/14 14:39:57 aw 1.8.14.6: RESYNC: (1.10-1.12); FILE MERGED 2008/03/14 13:55:37 cl 1.8.14.5: RESYNC: (1.9-1.10); FILE MERGED 2007/11/19 10:17:13 aw 1.8.14.4: #i39532# Lot of changes to make polygon stuff bezier-able 2007/11/07 14:24:30 aw 1.8.14.3: #i39532# committing to have a base for HDU 2007/08/09 22:05:30 aw 1.8.14.2: RESYNC: (1.8-1.9); FILE MERGED 2007/04/11 14:32:08 hdu 1.8.14.1: #i75669# cubic bezier curves can be loopy/spiky/complex: just splitting them up into simpler curves instead going all the way of splitting them up into line segments is preferable in many situations
Diffstat (limited to 'basegfx/test')
-rw-r--r--basegfx/test/basegfx2d.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx
index 782f41d68b4c..c51fc86534d6 100644
--- a/basegfx/test/basegfx2d.cxx
+++ b/basegfx/test/basegfx2d.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: basegfx2d.cxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
* This file is part of OpenOffice.org.
*
@@ -609,6 +609,18 @@ public:
"straight line 3" );
aPlotter.plot( aCrossing,
"crossing" );
+
+ // break up a complex bezier (loopy, spiky or self intersecting)
+ // into simple segments (left to right)
+ B2DCubicBezier aSegment = aCrossing;
+ double fExtremePos(0.0);
+
+ aPlotter.plot( aSegment, "segment" );
+ while(aSegment.getMinimumExtremumPosition(fExtremePos))
+ {
+ aSegment.split(fExtremePos, 0, &aSegment);
+ aPlotter.plot( aSegment, "segment" );
+ }
}
void tearDown()