Fixed: Invalid css width/height when using percent value

--HG--
branch : develop
This commit is contained in:
Nimetu 2019-08-09 11:08:20 +03:00
parent 923084a818
commit 39e0f4b4f2

View file

@ -723,6 +723,8 @@ namespace NLGUI
style.Width = tmpf * style.FontSize; style.Width = tmpf * style.FontSize;
else if (unit == "pt") else if (unit == "pt")
style.FontSize = tmpf / 0.75f; style.FontSize = tmpf / 0.75f;
else if (unit == "%")
style.Width = 0; // TODO: style.WidthRatio
else else
style.Width = tmpf; style.Width = tmpf;
} }
@ -739,6 +741,8 @@ namespace NLGUI
style.Height = tmpf * style.FontSize; style.Height = tmpf * style.FontSize;
else if (unit == "pt") else if (unit == "pt")
style.FontSize = tmpf / 0.75f; style.FontSize = tmpf / 0.75f;
else if (unit == "%")
style.Height = 0; // TODO: style.HeightRatio
else else
style.Height = tmpf; style.Height = tmpf;
} }
@ -755,6 +759,8 @@ namespace NLGUI
style.MaxWidth = tmpf * style.FontSize; style.MaxWidth = tmpf * style.FontSize;
else if (unit == "pt") else if (unit == "pt")
style.FontSize = tmpf / 0.75f; style.FontSize = tmpf / 0.75f;
else if (unit == "%")
style.MaxWidth = 0; // TODO: style.MaxWidthRatio
else else
style.MaxWidth = tmpf; style.MaxWidth = tmpf;
} }
@ -771,6 +777,8 @@ namespace NLGUI
style.MaxHeight = tmpf * style.FontSize; style.MaxHeight = tmpf * style.FontSize;
else if (unit == "pt") else if (unit == "pt")
style.FontSize = tmpf / 0.75f; style.FontSize = tmpf / 0.75f;
else if (unit == "%")
style.MaxHeight = 0; // TODO: style.MaxHeightRatio
else else
style.MaxHeight = tmpf; style.MaxHeight = tmpf;
} }