summaryrefslogtreecommitdiff
path: root/graphics/asymptote/texfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/texfile.h')
-rw-r--r--graphics/asymptote/texfile.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/graphics/asymptote/texfile.h b/graphics/asymptote/texfile.h
index cc9ffd8285..791e8dca64 100644
--- a/graphics/asymptote/texfile.h
+++ b/graphics/asymptote/texfile.h
@@ -246,7 +246,8 @@ public:
void miniprologue();
void writeshifted(path p, bool newPath=true);
- double hoffset() {return Hoffset;}
+ virtual double hoffset() {return Hoffset;}
+ virtual double voffset() {return box.bottom;}
// Draws label transformed by T at position z.
void put(const string& label, const transform& T, const pair& z,
@@ -264,6 +265,7 @@ class svgtexfile : public texfile {
size_t tensorcount;
bool inspecial;
static string nl;
+ pair offset;
public:
svgtexfile(const string& texname, const bbox& box, bool pipe=false) :
texfile(texname,box,pipe) {
@@ -272,6 +274,12 @@ public:
gouraudcount=0;
tensorcount=0;
inspecial=false;
+
+ *out << "\\catcode`\\%=12" << newl
+ << "\\def\\percent{%}" << newl
+ << "\\catcode`\\%=14" << newl;
+
+ offset=pair(box.left,box.top);
}
void writeclip(path p, bool newPath=true) {
@@ -281,9 +289,12 @@ public:
void dot(path p, pen, bool newPath=true);
void writeshifted(pair z) {
- write(conj(z)*settings::ps2tex);
+ write(conj(shift(-offset)*z)*settings::ps2tex);
}
+ double hoffset() {return Hoffset+offset.getx();}
+ double voffset() {return box.bottom+offset.gety();}
+
void translate(pair z) {}
void concat(transform t) {}
@@ -362,12 +373,6 @@ public:
void gouraudshade(const pen& pentype, const vm::array& pens,
const vm::array& vertices, const vm::array& edges);
- void begintensorshade(const vm::array& pens,
- const vm::array& boundaries,
- const vm::array& z);
- void tensorshade(const pen& pentype, const vm::array& pens,
- const vm::array& boundaries, const vm::array& z);
-
void beginclip();
void endclip0(const pen &p);