Added support for ex dimension

This commit is contained in:
M66B 2021-04-24 18:54:18 +02:00
parent 592ded9470
commit 802270160b
1 changed files with 2 additions and 0 deletions

View File

@ -1420,6 +1420,8 @@ public class HtmlHelper {
return Float.parseFloat(value.substring(0, value.length() - 3).trim());
if (value.endsWith("em"))
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) * current;
if (value.endsWith("ex")) // 1 ex = 0.5 em
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) / 2 * current;
if (value.endsWith("pt"))
return Float.parseFloat(value.substring(0, value.length() - 2).trim()) / DEFAULT_FONT_SIZE_PT;
if (value.endsWith("px"))