diff options
author | Norbert Preining <norbert@preining.info> | 2021-02-20 03:00:53 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-02-20 03:00:53 +0000 |
commit | b94dba90d83866ccb6db5273d214512e859c3179 (patch) | |
tree | 22d9aa93362d01d16e846322750afc738a05037a /graphics/asymptote/path3.cc | |
parent | f670508774c35b585b520fa9217d156664b4cb2a (diff) |
CTAN sync 202102200300
Diffstat (limited to 'graphics/asymptote/path3.cc')
-rw-r--r-- | graphics/asymptote/path3.cc | 14 |
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)]; |