diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-24 18:33:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-24 18:33:44 +0000 |
commit | dbd941ed19b558edd09219a372b2b0832957b283 (patch) | |
tree | 9c6af6f3924d8b1fff6638e510a907306342fa7d /Master/texmf-dist/asymptote/plain_picture.asy | |
parent | a360890a6c2a4befab6b48084d0731ad09c46631 (diff) |
asymptote 2.69 support files
git-svn-id: svn://tug.org/texlive/trunk@57876 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote/plain_picture.asy')
-rw-r--r-- | Master/texmf-dist/asymptote/plain_picture.asy | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/Master/texmf-dist/asymptote/plain_picture.asy b/Master/texmf-dist/asymptote/plain_picture.asy index 025e6741cfd..c0c189ee691 100644 --- a/Master/texmf-dist/asymptote/plain_picture.asy +++ b/Master/texmf-dist/asymptote/plain_picture.asy @@ -1355,50 +1355,43 @@ void gouraudshade(picture pic=currentpicture, path[] g, bool stroke=false, } void tensorshade(picture pic=currentpicture, path[] g, bool stroke=false, - pen fillrule=currentpen, pen[][] p, path[] b=g, + pen fillrule=currentpen, pen[][] p, path[] b=new path[], pair[][] z=new pair[][], bool copy=true) { + bool compact=b.length == 0 || b[0] == nullpath; if(copy) { g=copy(g); p=copy(p); - b=copy(b); + if(!compact) b=copy(b); z=copy(z); } pic.add(new void(frame f, transform t) { pair[][] Z=new pair[z.length][]; for(int i=0; i < z.length; ++i) Z[i]=t*z[i]; - tensorshade(f,t*g,stroke,fillrule,p,t*b,Z,false); + path[] G=t*g; + if(compact) + tensorshade(f,G,stroke,fillrule,p,Z,false); + else + tensorshade(f,G,stroke,fillrule,p,t*b,Z,false); },true); pic.addPath(g); } void tensorshade(frame f, path[] g, bool stroke=false, pen fillrule=currentpen, pen[] p, - path b=g.length > 0 ? g[0] : nullpath) + path b=g.length > 0 ? g[0] : nullpath, pair[] z=new pair[]) { - tensorshade(f,g,stroke,fillrule,new pen[][] {p},b); -} - -void tensorshade(frame f, path[] g, bool stroke=false, - pen fillrule=currentpen, pen[] p, - path b=g.length > 0 ? g[0] : nullpath, pair[] z) -{ - tensorshade(f,g,stroke,fillrule,new pen[][] {p},b,new pair[][] {z}); -} - -void tensorshade(picture pic=currentpicture, path[] g, bool stroke=false, - pen fillrule=currentpen, pen[] p, - path b=g.length > 0 ? g[0] : nullpath) -{ - tensorshade(pic,g,stroke,fillrule,new pen[][] {p},b); + tensorshade(f,g,stroke,fillrule,new pen[][] {p},b, + z.length > 0 ? new pair[][] {z} : new pair[][]); } void tensorshade(picture pic=currentpicture, path[] g, bool stroke=false, pen fillrule=currentpen, pen[] p, - path b=g.length > 0 ? g[0] : nullpath, pair[] z) + path b=nullpath, pair[] z=new pair[]) { - tensorshade(pic,g,stroke,fillrule,new pen[][] {p},b,new pair[][] {z}); + tensorshade(pic,g,stroke,fillrule,new pen[][] {p},b, + z.length > 0 ? new pair[][] {z} : new pair[][]); } // Smoothly shade the regions between consecutive paths of a sequence using a |