diff options
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/programs/program.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index c912de13fe..e5aae24997 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -3,6 +3,7 @@ #include <mbgl/gl/program.hpp> #include <mbgl/programs/program_parameters.hpp> +#include <sstream> #include <cassert> namespace mbgl { @@ -17,7 +18,11 @@ public: {} static std::string pixelRatioDefine(const ProgramParameters& parameters) { - return std::string("#define DEVICE_PIXEL_RATIO ") + std::to_string(parameters.pixelRatio) + "\n"; + std::ostringstream pixelRatioSS; + pixelRatioSS.imbue(std::locale("C")); + pixelRatioSS.setf(std::ios_base::showpoint); + pixelRatioSS << parameters.pixelRatio; + return std::string("#define DEVICE_PIXEL_RATIO ") + pixelRatioSS.str() + "\n"; } static std::string fragmentSource(const ProgramParameters& parameters) { |