From d6da893e66d83f4098a16c82dd299feadc453e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 11 Jun 2014 20:24:12 +0200 Subject: [PATCH] add comment for magic value --- src/renderer/painter_text.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/painter_text.cpp b/src/renderer/painter_text.cpp index b377d4e9f..5307a12ac 100644 --- a/src/renderer/painter_text.cpp +++ b/src/renderer/painter_text.cpp @@ -99,6 +99,8 @@ void Painter::renderText(TextBucket& bucket, const std::string& layer_name, cons // We're drawing in the translucent pass which is bottom-to-top, so we need // to draw the halo first. if (properties.halo[3] > 0.0f) { + // TODO: Get rid of the 2.4 magic value. It is currently 24 / 10, with 24 being the font size + // of the SDF glyphs. textShader->setGamma(properties.halo_blur * 2.4f / fontSize / map.getState().getPixelRatio()); textShader->setColor(properties.halo); textShader->setBuffer(properties.halo_radius); @@ -108,6 +110,8 @@ void Painter::renderText(TextBucket& bucket, const std::string& layer_name, cons if (properties.color[3] > 0.0f) { // Then, we draw the text over the halo + // TODO: Get rid of the 2.4 magic value. It is currently 24 / 10, with 24 being the font size + // of the SDF glyphs. textShader->setGamma(2.4f / fontSize / map.getState().getPixelRatio()); textShader->setColor(properties.color); textShader->setBuffer((256.0f - 64.0f) / 256.0f);