From 04e774dc375733b504787f8e3a9d1cdba05fbbce Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 21 Dec 2016 23:46:32 +0200 Subject: [PATCH 1/2] Backed out changeset: c1085bbb3dae --HG-- branch : develop --- code/nel/src/gui/ctrl_button.cpp | 5 ++++- code/nel/src/gui/view_bitmap.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/ctrl_button.cpp b/code/nel/src/gui/ctrl_button.cpp index a0e7111a2..02fd4b7d4 100644 --- a/code/nel/src/gui/ctrl_button.cpp +++ b/code/nel/src/gui/ctrl_button.cpp @@ -446,7 +446,10 @@ namespace NLGUI // *************************************************************************** sint32 CCtrlButton::getMaxUsedW() const { - return _W; + sint32 txw, txh; + CViewRenderer &rVR = *CViewRenderer::getInstance(); + rVR.getTextureSizeFromId (_TextureIdNormal, txw, txh); + return txw; } // *************************************************************************** diff --git a/code/nel/src/gui/view_bitmap.cpp b/code/nel/src/gui/view_bitmap.cpp index 2628b8e93..75a84dc77 100644 --- a/code/nel/src/gui/view_bitmap.cpp +++ b/code/nel/src/gui/view_bitmap.cpp @@ -511,7 +511,10 @@ namespace NLGUI // *************************************************************************** sint32 CViewBitmap::getMaxUsedW() const { - return _W; + sint32 txw, txh; + CViewRenderer &rVR = *CViewRenderer::getInstance(); + rVR.getTextureSizeFromId (_TextureId, txw, txh); + return txw; } // *************************************************************************** From 3fbfa4743bcf5428e3a3f21212e3e8fd049cad70 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 21 Dec 2016 23:47:50 +0200 Subject: [PATCH 2/2] Fixed: Wrong element width when using scaled texture. --HG-- branch : develop --- code/nel/src/gui/ctrl_button.cpp | 3 +++ code/nel/src/gui/view_bitmap.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/code/nel/src/gui/ctrl_button.cpp b/code/nel/src/gui/ctrl_button.cpp index 02fd4b7d4..457010859 100644 --- a/code/nel/src/gui/ctrl_button.cpp +++ b/code/nel/src/gui/ctrl_button.cpp @@ -446,6 +446,9 @@ namespace NLGUI // *************************************************************************** sint32 CCtrlButton::getMaxUsedW() const { + if (_Scale) + return _WReal; + sint32 txw, txh; CViewRenderer &rVR = *CViewRenderer::getInstance(); rVR.getTextureSizeFromId (_TextureIdNormal, txw, txh); diff --git a/code/nel/src/gui/view_bitmap.cpp b/code/nel/src/gui/view_bitmap.cpp index 75a84dc77..b479cb889 100644 --- a/code/nel/src/gui/view_bitmap.cpp +++ b/code/nel/src/gui/view_bitmap.cpp @@ -511,6 +511,9 @@ namespace NLGUI // *************************************************************************** sint32 CViewBitmap::getMaxUsedW() const { + if (_Scale) + return _WReal; + sint32 txw, txh; CViewRenderer &rVR = *CViewRenderer::getInstance(); rVR.getTextureSizeFromId (_TextureId, txw, txh);