summaryrefslogtreecommitdiff
path: root/graphics/asymptote/path3.cc
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/path3.cc')
-rw-r--r--graphics/asymptote/path3.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/graphics/asymptote/path3.cc b/graphics/asymptote/path3.cc
index 36dac92d2e..417fed2384 100644
--- a/graphics/asymptote/path3.cc
+++ b/graphics/asymptote/path3.cc
@@ -150,10 +150,16 @@ path3 path3::subpath(Int a, Int b) const
}
if (!cycles) {
- if (a < 0)
+ if (a < 0) {
a = 0;
- if (b > n-1)
+ if(b < 0)
+ b = 0;
+ }
+ if (b > n-1) {
b = n-1;
+ if(a > b)
+ a = b;
+ }
}
Int sn = b-a+1;
@@ -217,8 +223,8 @@ path3 path3::subpath(double a, double b) const
}
if (b > n-1) {
b = n-1;
- if (a > n-1)
- a = n-1;
+ if (a > b)
+ a = b;
}
aL = nodes[(Int)floor(a)];
aR = nodes[(Int)ceil(a)];