diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-03-25 14:12:41 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-03-25 14:12:41 +0100 |
commit | caef1259af1c843232dfbf5efc65adcf83d67f6f (patch) | |
tree | db2a4b76d4d14ca03d21e0bbf37c42759dda31a7 /tex/context/base/mkiv/lxml-css.lua | |
parent | cb28e8807d7908cc9644c2bd77c9d214dd8caefe (diff) | |
download | context-caef1259af1c843232dfbf5efc65adcf83d67f6f.tar.gz |
2021-03-25 14:03:00
Diffstat (limited to 'tex/context/base/mkiv/lxml-css.lua')
-rw-r--r-- | tex/context/base/mkiv/lxml-css.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/lxml-css.lua b/tex/context/base/mkiv/lxml-css.lua index 76cc4891e..48177c47c 100644 --- a/tex/context/base/mkiv/lxml-css.lua +++ b/tex/context/base/mkiv/lxml-css.lua @@ -233,7 +233,7 @@ do end end - function css.size(str,factors) + function css.size(str,factors, pct) local size, unit if type(str) == "table" then size, unit = str[1], str[2] @@ -241,7 +241,9 @@ do size, unit = lpegmatch(p_size,lower(str)) end if size and unit then - if factors then + if unit == "%" and pct then + return size * pct + elseif factors then return (factors[unit] or 1) * size else return size, unit |