Skip to content

Commit

Permalink
allow user input of tr_alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
dohyunkim committed Dec 6, 2024
1 parent 3ea4920 commit 0f880d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions luamplib.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -3379,9 +3379,10 @@ local function do_preobj_TR(object,prescript)
if opaq then
local key, on, os, new
local mode = prescript.tr_alternative or 1
mode = transparancy_modes[tonumber(mode) or mode]
mode = transparancy_modes[tonumber(mode) or mode:lower()]
if not mode then
warn("unsupported blend mode: '%s'", prescript.tr_alternative)
mode = prescript.tr_alternative
warn("unsupported blend mode: '%s'", mode)
end
opaq = format("%.3f", opaq) :gsub(decimals,rmzeros)
for i,v in ipairs{ {mode,opaq},{"Normal",1} } do
Expand Down
4 changes: 3 additions & 1 deletion test-luamplib-latex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@
draw test withpattern "mypatt" ;
\endmpfig
\mpfig
draw maketext "\bfseries\TeX" rotated 30 scaled 3
picture tex;
tex = mplibgraphictext "\bfseries\TeX" rotated 30 scaled 4;
draw tex
withshadingmethod "linear"
withshadingvector (3,0)
withshadingcolors (red,blue)
Expand Down

0 comments on commit 0f880d7

Please sign in to comment.