fix color parsing
This commit is contained in:
@@ -93,11 +93,12 @@ void TextBucket::addGlyphs(const PlacedGlyphs &glyphs, float placementZoom,
|
||||
// add the two triangles, referencing the four coordinates we just
|
||||
// inserted.
|
||||
triangleElementsBuffer->add(triangleIndex + 0, triangleIndex + 1,
|
||||
triangleIndex + 1);
|
||||
triangleIndex + 2);
|
||||
triangleElementsBuffer->add(triangleIndex + 1, triangleIndex + 2,
|
||||
triangleIndex + 3);
|
||||
|
||||
triangleGroup.vertex_length += glyph_vertex_length;
|
||||
triangleGroup.elements_length += 2;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -65,8 +65,6 @@ TextShader::TextShader()
|
||||
}
|
||||
|
||||
void TextShader::bind(char *offset) {
|
||||
fprintf(stderr, "bind textshader\n");
|
||||
|
||||
glEnableVertexAttribArray(a_pos);
|
||||
glVertexAttribPointer(a_pos, 2, GL_SHORT, false, 16, offset + 0);
|
||||
|
||||
|
||||
@@ -279,9 +279,9 @@ Color StyleParser::parseColor(JSVal value) {
|
||||
throw Style::exception("color values must be numbers");
|
||||
}
|
||||
|
||||
return {{static_cast<float>(r.GetDouble() / 255),
|
||||
static_cast<float>(g.GetDouble() / 255),
|
||||
static_cast<float>(b.GetDouble() / 255),
|
||||
return {{static_cast<float>(r.GetDouble()),
|
||||
static_cast<float>(g.GetDouble()),
|
||||
static_cast<float>(b.GetDouble()),
|
||||
static_cast<float>(a.GetDouble())}};
|
||||
|
||||
} else if (!value.IsString()) {
|
||||
|
||||
Reference in New Issue
Block a user