add comment for magic value

This commit is contained in:
Konstantin Käfer
2014-06-11 20:24:12 +02:00
parent 238488c413
commit d6da893e66

View File

@@ -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);