name text halo properties like others

This commit is contained in:
Justin R. Miller
2014-05-20 11:26:52 -07:00
parent 2f7b038608
commit 550e381e70
4 changed files with 10 additions and 10 deletions

View File

@@ -136,8 +136,8 @@ struct TextClass {
TranslateAnchor translateAnchor = TranslateAnchor::Map;
Color color = {{ 0, 0, 0, 1 }};
Color halo = {{ 1, 1, 1, 0.75 }};
FunctionProperty haloRadius = 0.25f;
FunctionProperty haloBlur = 1.0f;
FunctionProperty halo_radius = 0.25f;
FunctionProperty halo_blur = 1.0f;
FunctionProperty size = 12.0f;
FunctionProperty rotate = 0.0f;
FunctionProperty alwaysVisible = false;
@@ -150,8 +150,8 @@ struct TextProperties {
TranslateAnchor translateAnchor = TranslateAnchor::Map;
Color color = {{ 0, 0, 0, 1 }};
Color halo = {{ 1, 1, 1, 0.75 }};
float haloRadius = 0.25f;
float haloBlur = 1.0f;
float halo_radius = 0.25f;
float halo_blur = 1.0f;
float size = 12.0f;
float rotate = 0.0f;
bool alwaysVisible = false;

View File

@@ -96,9 +96,9 @@ 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) {
textShader->setGamma(properties.haloBlur * 2.4f / fontSize / map.getState().getPixelRatio());
textShader->setGamma(properties.halo_blur * 2.4f / fontSize / map.getState().getPixelRatio());
textShader->setColor(properties.halo);
textShader->setBuffer(properties.haloRadius);
textShader->setBuffer(properties.halo_radius);
glDepthRange(strata, 1.0f);
bucket.drawGlyphs(*textShader);
}

View File

@@ -111,8 +111,8 @@ void Style::cascade(float z) {
text.color = layer.color;
text.size = layer.size.evaluate<float>(z);
text.halo = layer.halo;
text.haloRadius = layer.haloRadius.evaluate<float>(z);
text.haloBlur = layer.haloBlur.evaluate<float>(z);
text.halo_radius = layer.halo_radius.evaluate<float>(z);
text.halo_blur = layer.halo_blur.evaluate<float>(z);
text.rotate = layer.rotate.evaluate<float>(z);
text.alwaysVisible = layer.alwaysVisible.evaluate<bool>(z);
text.opacity = layer.opacity.evaluate<float>(z);

View File

@@ -580,11 +580,11 @@ TextClass StyleParser::parseTextClass(JSVal value) {
}
if (value.HasMember("strokeWidth")) {
klass.haloRadius = parseFunction(value["strokeWidth"]);
klass.halo_radius = parseFunction(value["strokeWidth"]);
}
if (value.HasMember("strokeBlur")) {
klass.haloBlur = parseFunction(value["strokeBlur"]);
klass.halo_blur = parseFunction(value["strokeBlur"]);
}
if (value.HasMember("size")) {