summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/drawfill.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/drawfill.cc')
-rw-r--r--Build/source/utils/asymptote/drawfill.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/Build/source/utils/asymptote/drawfill.cc b/Build/source/utils/asymptote/drawfill.cc
index 443a7775d49..551b75cb0de 100644
--- a/Build/source/utils/asymptote/drawfill.cc
+++ b/Build/source/utils/asymptote/drawfill.cc
@@ -16,9 +16,9 @@ void drawAxialShade::palette(psfile *out)
{
pentype.convert();
penb.convert();
-
+
colorspace=(ColorSpace) max(pentype.colorspace(),penb.colorspace());
-
+
switch(colorspace) {
case RGB:
{
@@ -26,12 +26,12 @@ void drawAxialShade::palette(psfile *out)
else if (penb.grayscale()) penb.greytorgb();
break;
}
-
+
case CMYK:
{
if (pentype.grayscale()) pentype.greytocmyk();
else if (penb.grayscale()) penb.greytocmyk();
-
+
if (pentype.rgb()) pentype.rgbtocmyk();
else if (penb.rgb()) penb.rgbtocmyk();
break;
@@ -39,25 +39,25 @@ void drawAxialShade::palette(psfile *out)
default:
break;
}
-
+
out->gsave();
-}
-
+}
+
bool drawFill::draw(psfile *out)
{
if(pentype.invisible() || empty()) return true;
-
+
palette(out);
writepath(out);
fill(out);
return true;
}
-
+
drawElement *drawFill::transformed(const transform& t)
{
return new drawFill(transpath(t),stroke,transpen(t),KEY);
}
-
+
drawElement *drawLatticeShade::transformed(const transform& t)
{
return new drawLatticeShade(transpath(t),stroke,pentype,pens,t*T,KEY);
@@ -69,7 +69,7 @@ drawElement *drawAxialShade::transformed(const transform& t)
return new drawAxialShade(transpath(t),stroke,pentype,A,extenda,penb,B,
extendb,KEY);
}
-
+
drawElement *drawRadialShade::transformed(const transform& t)
{
pair A=t*a, B=t*b;
@@ -96,10 +96,10 @@ drawElement *drawTensorShade::transformed(const transform& t)
size_t zsize=z.size();
vm::array *Boundaries=new vm::array(size);
vm::array *Z=new vm::array(zsize);
-
+
for(size_t i=0; i < size; i++)
(*Boundaries)[i]=vm::read<path>(boundaries,i).transformed(t);
-
+
for(size_t i=0; i < zsize; i++) {
vm::array *zi=vm::read<vm::array *>(z,i);
size_t zisize=checkArray(zi);
@@ -110,16 +110,16 @@ drawElement *drawTensorShade::transformed(const transform& t)
}
return new drawTensorShade(transpath(t),stroke,pentype,pens,*Boundaries,*Z,
- KEY);
+ KEY);
}
bool drawFunctionShade::write(texfile *out, const bbox& box)
{
if(empty()) return true;
-
+
ColorSpace colorspace=pentype.colorspace();
size_t ncomponents=ColorComponents[colorspace];
-
+
out->verbatim("\\pdfobj stream attr {/FunctionType 4");
out->verbatim("/Domain [0 1 0 1]");
out->verbatim("/Range [");
@@ -129,7 +129,7 @@ bool drawFunctionShade::write(texfile *out, const bbox& box)
out->verbatimline(shader);
out->verbatimline("}}%");
out->verbatimline("\\edef\\lastobj{\\the\\pdflastobj}\\pdfrefobj\\lastobj");
-
+
out->verbatim("\\setbox\\ASYbox=\\hbox to ");
double Hoffset=out->hoffset();
double hoffset=(bpath.Max().getx()-Hoffset)*ps2tex;
@@ -149,7 +149,7 @@ bool drawFunctionShade::write(texfile *out, const bbox& box)
out->endspecial();
out->grestore();
out->verbatimline("}\\hfil}%");
-
+
out->verbatimline("\\pdfxform resources {");
out->verbatimline("/Shading << /Sh << /ShadingType 1");
out->verbatim("/Matrix [");
@@ -160,7 +160,7 @@ bool drawFunctionShade::write(texfile *out, const bbox& box)
out->verbatim("/ColorSpace /Device");
out->verbatimline(ColorDeviceSuffix[colorspace]);
out->verbatimline("/Function \\lastobj\\space 0 R >> >>}\\ASYbox");
-
+
out->verbatimline("\\pdfrefxform\\the\\pdflastxform");
out->verbatim("\\kern");
out->write(-hoffset);