diff options
author | Karl Berry <karl@freefriends.org> | 2016-03-14 22:52:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-03-14 22:52:10 +0000 |
commit | 355bf72b81c6931539dd365430e78ebc10bcd0a2 (patch) | |
tree | ff9e855fb9eeb6cbc286d58e6cfe07bdb9cdf4ba /Build/source/utils/asymptote/path.cc | |
parent | 1cdee1080e0ad8f88624629e00039d9fe89c1b54 (diff) |
asy 2.37 sources
git-svn-id: svn://tug.org/texlive/trunk@40025 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/path.cc')
-rw-r--r-- | Build/source/utils/asymptote/path.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/path.cc b/Build/source/utils/asymptote/path.cc index 6fa9c1f5634..dce0cef63c5 100644 --- a/Build/source/utils/asymptote/path.cc +++ b/Build/source/utils/asymptote/path.cc @@ -346,10 +346,16 @@ path path::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; @@ -411,8 +417,8 @@ path path::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)]; |