summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/psfile.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-08-15 23:57:48 +0000
committerKarl Berry <karl@freefriends.org>2009-08-15 23:57:48 +0000
commit16d128e5e10d541a78654b86409d5a3539f07708 (patch)
tree66de0af63c3811bb3040c16e9b52c11985f70811 /Build/source/utils/asymptote/psfile.cc
parentb20f78c549859ec0e8610bdd3ad904245e86b489 (diff)
asymptote 1.83
git-svn-id: svn://tug.org/texlive/trunk@14696 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/psfile.cc')
-rw-r--r--Build/source/utils/asymptote/psfile.cc36
1 files changed, 22 insertions, 14 deletions
diff --git a/Build/source/utils/asymptote/psfile.cc b/Build/source/utils/asymptote/psfile.cc
index 506821d7f28..4605758de67 100644
--- a/Build/source/utils/asymptote/psfile.cc
+++ b/Build/source/utils/asymptote/psfile.cc
@@ -345,7 +345,7 @@ void psfile::latticeshade(const vm::array& a, const bbox& b)
}
// Axial and radial shading
-void psfile::gradientshade(bool axial, const ColorSpace &colorspace,
+void psfile::gradientshade(bool axial, ColorSpace colorspace,
const pen& pena, const pair& a, double ra,
const pen& penb, const pair& b, double rb)
{
@@ -406,6 +406,16 @@ void psfile::gouraudshade(const array& pens, const array& vertices,
<< "shfill" << newl;
}
+void psfile::vertexpen(array *pi, int j, ColorSpace colorspace)
+{
+ pen *p=read<pen *>(pi,j);
+ p->convert();
+ if(!p->promote(colorspace))
+ reportError(inconsistent);
+ *out << " ";
+ write(*p);
+}
+
// Tensor-product patch shading
void psfile::tensorshade(const array& pens, const array& boundaries,
const array& z)
@@ -435,10 +445,10 @@ void psfile::tensorshade(const array& pens, const array& boundaries,
path g=read<path>(boundaries,i);
if(!(g.cyclic() && g.size() == 4))
reportError("specify cyclic path of length 4");
- for(Int j=0; j < 4; ++j) {
+ for(Int j=4; j > 0; --j) {
write(g.point(j));
- write(g.postcontrol(j));
- write(g.precontrol(j+1));
+ write(g.precontrol(j));
+ write(g.postcontrol(j-1));
}
if(nz == 0) { // Coons patch
static double nineth=1.0/9.0;
@@ -452,21 +462,19 @@ void psfile::tensorshade(const array& pens, const array& boundaries,
array *zi=read<array *>(z,i);
if(checkArray(zi) != 4)
reportError("specify 4 internal control points for each path");
- for(Int j=0; j < 4; ++j)
- write(read<pair>(zi,j));
+ write(read<pair>(zi,0));
+ write(read<pair>(zi,3));
+ write(read<pair>(zi,2));
+ write(read<pair>(zi,1));
}
array *pi=read<array *>(pens,i);
if(checkArray(pi) != 4)
reportError("specify 4 pens for each path");
- for(Int j=0; j < 4; ++j) {
- pen *p=read<pen *>(pi,j);
- p->convert();
- if(!p->promote(colorspace))
- reportError(inconsistent);
- *out << " ";
- write(*p);
- }
+ vertexpen(pi,0,colorspace);
+ vertexpen(pi,3,colorspace);
+ vertexpen(pi,2,colorspace);
+ vertexpen(pi,1,colorspace);
*out << newl;
}