summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-12-20 22:02:49 +0000
committerKarl Berry <karl@freefriends.org>2013-12-20 22:02:49 +0000
commit58585d5aef30c63a28a50a637af87f7b84709622 (patch)
treee9d2a815672e27a952b9d6b6e5fa0ee5b0731073 /Master/texmf-dist/tex/luatex
parent686feafdfa728f8f337210a65b380f168e4a68fe (diff)
luamplib (20dec13)
git-svn-id: svn://tug.org/texlive/trunk@32458 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.lua14
1 files changed, 5 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
index fe8c03cc1a9..e818c56c1e4 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
@@ -352,9 +352,7 @@ local function putTEXboxes (object)
if sx == 0 then sx = 0.00001 end
if sy == 0 then sy = 0.00001 end
local cs = object.color
- if cs and #cs > 0 then
- cs = luamplib.colorconverter(cs)
- end
+ if cs then cs = luamplib.colorconverter(cs) end
pdf_literalcode("q %f %f %f %f %f %f cm",sx,rx,ry,sy,tx,ty)
if cs then pdf_literalcode(cs) end
texsprint(format("\\mplibputtextbox{%i}",n))
@@ -468,18 +466,16 @@ local function flush(result,flusher)
elseif objecttype == "text" then
local ot = object.transform -- 3,4,5,6,1,2
local cs = object.color
- if cs and #cs > 0 then
- cs = luamplib.colorconverter(cs)
- end
+ if cs then cs = luamplib.colorconverter(cs) end
pdf_literalcode("q %f %f %f %f %f %f cm",ot[3],ot[4],ot[5],ot[6],ot[1],ot[2])
if cs then pdf_literalcode(cs) end
pdf_textfigure(object.font,object.dsize,object.text,object.width,object.height,object.depth)
pdf_literalcode("Q")
else
local cs, cr = object.color, nil
- if cs and #cs > 0 then
+ if cs then
cs, cr = luamplib.colorconverter(cs)
- pdf_literalcode(cs)
+ if cs then pdf_literalcode(cs) end
end
local ml = object.miterlimit
if ml and ml ~= miterlimit then
@@ -586,7 +582,7 @@ local function colorconverter(cr)
elseif n == 3 then
local r, g, b = cr[1], cr[2], cr[3]
return format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b), "0 g 0 G"
- else
+ elseif n == 1 then
local s = cr[1]
return format("%.3f g %.3f G",s,s), "0 g 0 G"
end