summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/plain_Label.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-08 00:57:31 +0000
committerKarl Berry <karl@freefriends.org>2009-06-08 00:57:31 +0000
commit9e32dd6aee7faf4e59888cfbd7a927d497b563ad (patch)
tree5068ec13390f4352be663383dd58e22147e68201 /Build/source/utils/asymptote/base/plain_Label.asy
parent3f49bad6cd5234b4e0ea156f6f68f6430643c10f (diff)
asymptote 1.76
git-svn-id: svn://tug.org/texlive/trunk@13664 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/base/plain_Label.asy')
-rw-r--r--Build/source/utils/asymptote/base/plain_Label.asy20
1 files changed, 17 insertions, 3 deletions
diff --git a/Build/source/utils/asymptote/base/plain_Label.asy b/Build/source/utils/asymptote/base/plain_Label.asy
index 1279880ca3a..3c11a2cedbd 100644
--- a/Build/source/utils/asymptote/base/plain_Label.asy
+++ b/Build/source/utils/asymptote/base/plain_Label.asy
@@ -571,7 +571,12 @@ path[] texpath(Label L, bool tex=settings.tex != "none")
path[] g;
string s=L.s;
- pen p=L.p;
+ pen p=fontcommand(font(L.p))+fontsize(fontsize(L.p));
+
+ // PDF tex engines lose track of the baseline.
+ bool adjust=tex && basealign(L.p) == 1 && pdf();
+ if(adjust) p=p+basealign;
+
int k=0;
int i;
while((i=find(stringcache == s,++k)) >= 0) {
@@ -582,7 +587,16 @@ path[] texpath(Label L, bool tex=settings.tex != "none")
}
if(i == -1) {
- g=tex ? _texpath(s,p) : textpath(s,p);
+ if(tex) {
+ if(adjust) {
+ g=_texpath("."+s,p);
+ if(g.length == 0) return g;
+ real y=min(g[0]).y;
+ g.delete(0);
+ g=shift(0,-y)*g;
+ } else g=_texpath(s,p);
+ } else g=textpath(s,p);
+
stringcache.push(s);
pencache.push(p);
pathcache.push(g);
@@ -593,7 +607,7 @@ path[] texpath(Label L, bool tex=settings.tex != "none")
pair m=min(g);
pair M=max(g);
pair dir=rectify(inverse(L.T)*-L.align.dir);
- if(basealign(p) == 1)
+ if(tex && basealign(L.p) == 1)
dir -= (0,(1-dir.y)*m.y/(M.y-m.y));
a=m+realmult(dir,M-m);