Fix previous commit, this caused regression with merged lines/polygons
@@ -202,7 +202,7 @@ namespace {
void main(void) {
int styleIndex = int(aVertexAttribs[0]);
float width = uWidthTable[styleIndex] * uHalfResolution;
- float roundedWidth = width + 1.0;
+ float roundedWidth = width + float(width > 0.0);
float gamma = uGamma * aVertexAttribs[3];
#ifdef TRANSFORM
vec3 pos = vec3(vec2(uTransformMatrix * vec3(aVertexPosition, 1.0)) + uBinormalScale * roundedWidth * aVertexBinormal, 0.0);
@@ -1824,7 +1824,7 @@ namespace carto { namespace vt {
for (int i = 0; i < styleParams.parameterCount; i++) {
float width = 0.5f * std::abs((*styleParams.widthTable[i])(_viewState)) * geometry->getGeometryScale() / geometry->getTileSize();
float pixelWidth = 2.0f * _halfResolution * width;
- if (pixelWidth < 1.0f) {
+ if (pixelWidth > 0.0f && pixelWidth < 1.0f) {
colors[i] = colors[i] * pixelWidth; // should do gamma correction here, but simple implementation gives closer results to Mapnik
width = 1.0f / (2.0f * _halfResolution);
}
