summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/plain_paths.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-08 00:57:31 +0000
committerKarl Berry <karl@freefriends.org>2009-06-08 00:57:31 +0000
commit9e32dd6aee7faf4e59888cfbd7a927d497b563ad (patch)
tree5068ec13390f4352be663383dd58e22147e68201 /Build/source/utils/asymptote/base/plain_paths.asy
parent3f49bad6cd5234b4e0ea156f6f68f6430643c10f (diff)
asymptote 1.76
git-svn-id: svn://tug.org/texlive/trunk@13664 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/base/plain_paths.asy')
-rw-r--r--Build/source/utils/asymptote/base/plain_paths.asy10
1 files changed, 6 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/base/plain_paths.asy b/Build/source/utils/asymptote/base/plain_paths.asy
index 486f3f0cc7b..d457fa5bc28 100644
--- a/Build/source/utils/asymptote/base/plain_paths.asy
+++ b/Build/source/utils/asymptote/base/plain_paths.asy
@@ -329,19 +329,21 @@ pair inside(path p, pen fillrule=currentpen)
int n=length(p);
for(int i=0; i < n; ++i) {
pair z=point(p,i);
- real[] T=intersections(p,z,z+I*dir(p,i));
+ pair dir=dir(p,i);
+ if(dir == 0) continue;
+ real[] T=intersections(p,z,z+I*dir);
// Check midpoints of line segments formed between the
// corresponding intersection points and z.
for(int j=0; j < T.length; ++j) {
if(T[j] != i) {
pair w=point(p,T[j]);
pair m=0.5*(z+w);
- if(inside(windingnumber(p,m),fillrule)) return m;
+ if(interior(windingnumber(p,m),fillrule)) return m;
}
}
}
- abort("cannot find an interior point");
- return 0;
+ // cannot find an interior point: path is degenerate
+ return point(p,0);
}
// Return all intersection times of path g with the vertical line through (x,0).