Fix display. This stuff now works.

This commit is contained in:
Tom MacWright
2012-10-16 18:13:58 -04:00
parent 9343719737
commit 824b82bbe1
2 changed files with 11 additions and 9 deletions
+4 -2
View File
@@ -29,9 +29,11 @@ declare("iD.styleparser.Rule", null, {
test:function(entity,tags,zoom) {
// summary: Evaluate the Rule on the given entity, tags and zoom level.
// returns: true if the Rule passes, false if the conditions aren't fulfilled.
if (this.subject !== '' && !entity.entity.isType(this.subject)) { return false; }
if ((this.subject !== '') && (entity.entityType !== this.subject)) {
return false;
}
if (zoom<this.minZoom || zoom>this.maxZoom) { return false; }
var v=true; var i=0; var isAnd=this.isAnd;
array.forEach(this.conditions, function(condition) {
var r=condition.test(tags);
+7 -7
View File
@@ -62,20 +62,20 @@ declare("iD.styleparser.RuleChain", null, {
test:function(pos, entity, tags, zoom) {
// summary: Test a rule chain by running all the tests in reverse order.
if (this.rules.length==0) { return false; }
if (this.rules.length === 0) { return false; }
if (pos==-1) { pos=this.rules.length-1; }
var r=this.rules[pos];
var r = this.rules[pos];
if (!r.test(entity, tags, zoom)) { return false; }
if (pos==0) { return true; }
if (pos === 0) { return true; }
var o = entity.entity.parentObjects();
for (var i=0; i<o.length; i++) {
for (var i = 0; i < o.length; i++) {
var p=o[i];
if (this.test(pos-1, p, p.tags, zoom)) { return true; }
}
return false;
},
}
});