Added getRatio function to AbsoluteOrRelativeValue

0.8
Bruno Van de Velde 2017-08-30 23:29:40 +02:00
parent d8bf087373
commit 348ed0f580
1 changed files with 12 additions and 1 deletions

View File

@ -105,13 +105,24 @@ namespace tgui
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns the stored ratio
///
/// @return The ratio that is multiplied with the parent size to get the value, when the value isn't a constant
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TGUI_CONSTEXPR float getRatio() const
{
return m_ratio;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
/// @brief Update the size to which the value depends on if the value is relative
///
/// @param newParentSize New size from which to take the relative value
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TGUI_CONSTEXPR void updateParentSize(float newParentSize)
void updateParentSize(float newParentSize)
{
if (!m_constant)
{