diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-06-11 15:52:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-06-11 15:52:00 +0200 |
commit | 04d53999d96e5526ac6f587ae30215b29213c753 (patch) | |
tree | 6f93a7f05fbbdbbaa596b1efd0ecfbb74fe8d0c6 /tex/context/base/back-pdf.lua | |
parent | b7bf9474dd20221297fb47bf90c1ab6c6a2d9306 (diff) | |
download | context-04d53999d96e5526ac6f587ae30215b29213c753.tar.gz |
beta 2014.06.11 15:52
Diffstat (limited to 'tex/context/base/back-pdf.lua')
-rw-r--r-- | tex/context/base/back-pdf.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tex/context/base/back-pdf.lua b/tex/context/base/back-pdf.lua index 9eb4a9b73..2fbaaa0d2 100644 --- a/tex/context/base/back-pdf.lua +++ b/tex/context/base/back-pdf.lua @@ -38,13 +38,17 @@ end -- -- we could also do the save restore wrapping here + colorhack +local pdfsave = nodes.pool.pdfsave +local pdfrestore = nodes.pool.pdfrestore local pdfsetmatrix = nodes.pool.pdfsetmatrix + local stack = { } local function popmatrix() local top = remove(stack) if top then context(pdfsetmatrix(unpack(top))) + context(pdfrestore()) end end @@ -53,6 +57,7 @@ function commands.pdfstartrotation(a) insert(stack,false) else local s, c = sind(a), cosd(a) + context(pdfsave()) context(pdfsetmatrix(c,s,-s,c)) insert(stack,{ c, -s, s, c }) end @@ -68,6 +73,7 @@ function commands.pdfstartscaling(sx,sy) if sy == 0 then sy = 0.0001 end + context(pdfsave()) context(pdfsetmatrix(sx,0,0,sy)) insert(stack,{ 1/sx, 0, 0, 1/sy }) end @@ -81,6 +87,7 @@ function commands.pdfstartmatrix(sx,rx,ry,sy) -- tx, ty if sx == 1 and rx == 0 and ry == 0 and sy == 1 then insert(stack,false) else + context(pdfsave()) context(pdfsetmatrix(sx,rx,ry,sy)) insert(stack,{ -sx, -rx, -ry, -sy }) end @@ -88,5 +95,7 @@ end commands.pdfstoprotation = popmatrix commands.pdfstopscaling = popmatrix -commands.pdfstopmirroring = commands.pdfstartmirroring +commands.pdfstopmirroring = popmatrix commands.pdfstopmatrix = popmatrix + +-- todo : clipping |