Skip to content

Commit

Permalink
Unignore fill-opacity property-function test (#3061)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaswoj authored Aug 25, 2016
1 parent 9309bb2 commit efdb86a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 3 additions & 1 deletion js/style/style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ StyleLayer.prototype = util.inherit(Evented, {
if (this.minzoom && zoom < this.minzoom) return true;
if (this.maxzoom && zoom >= this.maxzoom) return true;
if (this.layout['visibility'] === 'none') return true;
if (this.paint[this.type + '-opacity'] === 0) return true;
if (this.isPaintValueFeatureConstant(this.type + '-opacity') && this.paint[this.type + '-opacity'] === 0) return true;
if (this.isPaintValueFeatureConstant(this.type + '-color') && this.paint[this.type + '-color'] && this.paint[this.type + '-color'][3] === 0) return true;

return false;
},

Expand Down
18 changes: 18 additions & 0 deletions js/style/style_layer/fill_style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ FillStyleLayer.prototype = util.inherit(StyleLayer, {
} else {
return StyleLayer.prototype.isPaintValueZoomConstant.call(this, name);
}
},

isHidden: function(zoom) {
if (this.minzoom && zoom < this.minzoom) return true;
if (this.maxzoom && zoom >= this.maxzoom) return true;
if (this.layout['visibility'] === 'none') return true;

var isFillHidden = (
(this.isPaintValueFeatureConstant('fill-opacity') && this.paint['fill-opacity'] === 0) ||
(this.isPaintValueFeatureConstant('fill-color') && this.paint['fill-color'][3] === 0)
);

var isOutlineHidden = (
this.isPaintValueFeatureConstant('fill-outline-color') &&
this.paint['fill-outline-color'][3] === 0
);

return isFillHidden && isOutlineHidden;
}

});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"jsdom-global": "^2.1.0",
"json-loader": "^0.5.4",
"lodash": "^4.13.1",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#3e36b193a0c442a3fd863119f101afa6db97b32d",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#35efbce663a0f13d37d34afac799e33178ee610a",
"memory-fs": "^0.3.0",
"minifyify": "^7.0.1",
"npm-run-all": "^3.0.0",
Expand Down

0 comments on commit efdb86a

Please sign in to comment.