Skip to content

Commit

Permalink
minor change re shading
Browse files Browse the repository at this point in the history
  • Loading branch information
dohyunkim committed Jul 31, 2024
1 parent dffd5ff commit df06e9d
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions luamplib.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -3263,7 +3263,6 @@ local function do_preobj_SH(object,prescript)
else
err"unknown shading type"
end
pdf_literalcode("q /Pattern cs")
end
return shade_no
end
Expand Down Expand Up @@ -3894,10 +3893,6 @@ function luamplib.flush (result,flusher)
pdf_literalcode("[] 0 d")
dashed = false
end
% \end{macrocode}
% Added : shading
% \begin{macrocode}
local shade_no = do_preobj_SH(object,prescript) -- shading
local path = object.path
local transformed, penwidth = false, 1
local open = path and path[1].left_type and path[#path].right_type
Expand All @@ -3913,6 +3908,14 @@ function luamplib.flush (result,flusher)
objecttype = 'fill'
end
end
% \end{macrocode}
% Added : shading
% \begin{macrocode}
local shade_no = do_preobj_SH(object,prescript) -- shading
if shade_no then
pdf_literalcode"q /Pattern cs"
objecttype = false
end
if transformed then
start_pdf_code()
end
Expand All @@ -3933,21 +3936,16 @@ function luamplib.flush (result,flusher)
else
flushnormalpath(path,open)
end
% \end{macrocode}
% Shading seems to conflict with these ops
% \begin{macrocode}
if not shade_no then -- conflict with shading
if objecttype == "fill" then
pdf_literalcode(evenodd and "h f*" or "h f")
elseif objecttype == "outline" then
if both then
pdf_literalcode(evenodd and "h B*" or "h B")
else
pdf_literalcode(open and "S" or "h S")
end
elseif objecttype == "both" then
if objecttype == "fill" then
pdf_literalcode(evenodd and "h f*" or "h f")
elseif objecttype == "outline" then
if both then
pdf_literalcode(evenodd and "h B*" or "h B")
else
pdf_literalcode(open and "S" or "h S")
end
elseif objecttype == "both" then
pdf_literalcode(evenodd and "h B*" or "h B")
end
end
if transformed then
Expand Down

0 comments on commit df06e9d

Please sign in to comment.