Fix vs2008 build

merge/2021-11-19
kaetemi 3 years ago
parent ac9e8f4f5e
commit 1eec1fe31e
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -438,7 +438,7 @@ namespace NLGUI
if (bg.repeatX == CSS_VALUE_ROUND)
{
sint numTiles = std::max(1, (sint)std::round((float)areaW / texW));
sint numTiles = std::max(1, (sint)std::ceil(((float)areaW / texW) - 0.5f));
texW = areaW / numTiles;
if (bg.height.isAuto() && bg.repeatY != CSS_VALUE_ROUND)
{
@ -449,7 +449,7 @@ namespace NLGUI
if (bg.repeatY == CSS_VALUE_ROUND)
{
sint numTiles = std::max(1, (sint)std::round((float)areaH / texH));
sint numTiles = std::max(1, (sint)std::ceil(((float)areaH / texH) - 0.5f));
texH = areaH / numTiles;
if (bg.width.isAuto() && bg.repeatX != CSS_VALUE_ROUND)
{

@ -30,9 +30,10 @@ namespace NLGUI
bool CSSLength::parseValue(const std::string &value, bool allowPercent, bool allowNegative)
{
static const std::set<std::string> knownUnits = {
static const std::string knownUnitsArr[] = {
"%", "rem", "em", "px", "pt", "vw", "vh", "vi", "vb", "vmin", "vmax"
};
static const std::set<std::string> knownUnits(knownUnitsArr, &knownUnitsArr[sizeof(knownUnitsArr) / sizeof(knownUnitsArr[0])]);
std::string::size_type pos = 0;
std::string::size_type len = value.size();

@ -208,9 +208,10 @@ namespace NLGUI
// ***************************************************************************
bool getCssLength (float &value, std::string &unit, const std::string &str, bool neg)
{
static const std::set<std::string> knownUnits = {
static const std::string knownUnitsArr[] = {
"%", "rem", "em", "px", "pt", "vw", "vh", "vi", "vb", "vmin", "vmax"
};
static const std::set<std::string> knownUnits(knownUnitsArr, &knownUnitsArr[sizeof(knownUnitsArr) / sizeof(knownUnitsArr[0])]);
std::string::size_type pos = 0;
std::string::size_type len = str.size();

Loading…
Cancel
Save