diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index bae705934..de76cb728 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -854,6 +854,26 @@ bool split_config_string(const std::string &str, std::mapgetScreenWidth(true); + if ((_x + ret) >= xRes) + ret = xRes-_x-1; + if (ret%4 == 0) + return ret; + + int add = (max) ? 3 : 0; + ret = ((ret + add) / 4) * 4; + if ((_x + ret) >= xRes) + ret -= 4; + + return ret; +} + std::vector split(const std::string &s, char delim) { std::vector vec; diff --git a/src/system/helpers.h b/src/system/helpers.h index 205a4f30a..b6da33508 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -95,6 +95,8 @@ class CFileHelpers static uint64_t getDirSize(const std::string& dir){return getDirSize(dir.c_str());}; }; +uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); + std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long);