From 39e0f4b4f24031e2391b3cb3320ce9f871310509 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 9 Aug 2019 11:08:20 +0300 Subject: [PATCH] Fixed: Invalid css width/height when using percent value --HG-- branch : develop --- code/nel/src/gui/css_style.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/nel/src/gui/css_style.cpp b/code/nel/src/gui/css_style.cpp index b0b536d0d..b83d14ead 100644 --- a/code/nel/src/gui/css_style.cpp +++ b/code/nel/src/gui/css_style.cpp @@ -723,6 +723,8 @@ namespace NLGUI style.Width = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.Width = 0; // TODO: style.WidthRatio else style.Width = tmpf; } @@ -739,6 +741,8 @@ namespace NLGUI style.Height = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.Height = 0; // TODO: style.HeightRatio else style.Height = tmpf; } @@ -755,6 +759,8 @@ namespace NLGUI style.MaxWidth = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.MaxWidth = 0; // TODO: style.MaxWidthRatio else style.MaxWidth = tmpf; } @@ -771,6 +777,8 @@ namespace NLGUI style.MaxHeight = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.MaxHeight = 0; // TODO: style.MaxHeightRatio else style.MaxHeight = tmpf; }