Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure fills with transparent colors and patterns are rendered as expected #3120

Merged
merged 2 commits into from
Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions js/style/style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ 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.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: 0 additions & 18 deletions js/style/style_layer/fill_style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,6 @@ 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
10 changes: 0 additions & 10 deletions js/style/style_layer/symbol_style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ module.exports = SymbolStyleLayer;

SymbolStyleLayer.prototype = util.inherit(StyleLayer, {

isHidden: function() {
if (StyleLayer.prototype.isHidden.apply(this, arguments)) return true;

var isTextHidden = this.paint['text-opacity'] === 0 || !this.layout['text-field'];
var isIconHidden = this.paint['icon-opacity'] === 0 || !this.layout['icon-image'];
if (isTextHidden && isIconHidden) return true;

return false;
},

getLayoutValue: function(name, globalProperties, featureProperties) {
if (name === 'text-rotation-alignment' &&
this.getLayoutValue('symbol-placement', globalProperties, featureProperties) === 'line' &&
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"jsdom": "^9.4.2",
"json-loader": "^0.5.4",
"lodash": "^4.13.1",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#35efbce663a0f13d37d34afac799e33178ee610a",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#333cf135f5358f48abd608a62787045a5f6fac0c",
"memory-fs": "^0.3.0",
"minifyify": "^7.0.1",
"npm-run-all": "^3.0.0",
Expand Down